---
id: TST-PFM-DJE-173
title: Upload persistence
kind: integration
product_area: platform
module: data-job-engine
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: services-platform
files:
  - modules/data-jobs/tests/integration/services/persistence/uploads.integration.spec.js
implements: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Suite-owned fixture records, job identifiers and workspace contexts; teardown removes the fixture
  data.
evidence:
  - >-
    services-platform:modules/data-jobs/tests/integration/services/persistence/uploads.integration.spec.js
assertion_inventory:
  - 'data-job uploads: opening a session'
  - 'writes the session open, with the declaration, the key and the upload id the capability chose'
  - carries no fact of a finished object while the session is open
  - stamps the caller as the creator at version one
  - 'records a digest the client declared, so the job layer can verify it while it streams'
  - 'records no digest when the client declared none, rather than an empty string'
  - 'writes the session in the tenant of the execution, whatever the key spells'
  - 'data-job uploads: completing a session'
  - moves the session to completed and records what S3 stored
  - 'stamps the instant the object was completed, from the execution\u2019s own clock'
  - 'raises the version, because a completion is a write like any other'
  - 'records no digest of its own, because S3 computes none for a multipart upload'
  - 'records a digest when S3 did compute one, which is the branch kept for the day it does'
  - refuses a completion whose object is not the size that was declared
  - 'leaves the session open after refusing it, so the client may upload the rest and complete again'
  - refuses a second completion of a session that is already completed
  - refuses the completion of a session that was aborted
  - refuses the completion of a session no tenant of this execution has
  - 'data-job uploads: settling a session'
  - moves an open session to aborted
  - 'moves an open session to expired, which is what an abandoned one becomes'
  - answers the same state a second time rather than refusing an abort that is repeated
  - 'refuses to abandon a session that has completed, whose object a job may already be reading'
  - leaves the completed session exactly as it was after refusing to abandon it
  - 'data-job uploads: a tenant reaches its own sessions only'
  - 'finds its own session, which is the premise every absence below is measured against'
  - 'holds the other tenant\u2019s session in the table, read as the owner'
  - does not find the other tenant\u2019s session
  - >-
    refuses the other tenant\u2019s session as one that could not be located, telling a caller
    nothing else
  - cannot complete the other tenant\u2019s session
  - leaves the other tenant\u2019s session open after that refusal
  - cannot abort the other tenant\u2019s session
  - 'data-job uploads: what a client may declare'
  - 'accepts a declaration of a file name, a content type and a size'
  - 'trims the file name, which is what the database would have done anyway'
  - 'refuses a file name that is only whitespace, rather than storing a blank'
  - 'refuses a file name that is a path, which would choose the object\u2019s prefix'
  - refuses a file name longer than the column holds
  - refuses a content type no data job can read
  - 'refuses a size of zero, because an empty file has nothing to load'
  - refuses a size that is not a whole number of bytes
  - refuses a size larger than the 5 TiB S3 stores in one object
  - accepts a digest of 64 lower-case hexadecimal characters
  - 'refuses a digest in any other form, without echoing what was sent'
registration_note: Registration describes existing source; the suite is not executed by this documentation job.
---

# Upload persistence

## Verification Boundary

The suite checks the production service or shared engine against its database fixture. The structured assertion inventory records the checks present at the pinned revision.

## What This Suite Proves

The existing checks exercise upload persistence. The specification bindings identify the narrower outcomes supported by those assertions.

## What It Does Not Prove

Local execution does not establish deployed queue, storage or service behavior. Independent test cases do not establish a complete cross-feature process.

## Real Dependencies and Test Doubles

The owning service exercises production persistence and domain behavior against real Postgres. The fixture supplies caller contexts; queue delivery, storage and external calls are doubled where the file installs a test port.

## Must Not Be Doubled

The database effects, security context and production operation under examination remain real. Their outcomes cannot be replaced with canned success responses.
