Skip to content

ATS-PFM-DJE-014Process file jobs within shared workload limits: Capability Test Specification

Markdown

ATS-PFM-DJE-014

Process file jobs within shared workload limits: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaPlatformModuleData Job EngineRevision2

Read atmacroservice-libraries 54536a44services-crm a8d1364f

Coverage

  • Rule covered
  • Transition gap: FND-PFM-DJE-074
  • Validation covered
  • Permission gap: FND-PFM-DJE-074
  • Edge covered
  • Failure covered
  • Boundary covered
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

12 scenarios proving CAP-PFM-DJE-014; 8 bound to an existing test.

01 File submission requires an available completed uploadvalidationapinegativetest
Proves
BR-CAP-PFM-DJE-014-01
Preconditions
Prepare foreign, absent and still-open upload identifiers.
Steps
[ { "do": "Submit jobs referencing each.", "expect": "Foreign and absent uploads have indistinguishable refusals; unfinished input identifies its state.", "provenance": "test", "source": "services-crm:modules/data-jobs/tests/e2e/bulk-data-jobs.e2e.spec.js#refuses an upload of another tenant with 400, saying only that it was not found" } ]
Expected
Foreign and absent uploads have indistinguishable refusals; unfinished input identifies its state.
Data
Upload fixtures.
Bound to
Source
services-crm:modules/data-jobs/tests/e2e/bulk-data-jobs.e2e.spec.js#refuses an upload of another tenant with 400, saying only that it was not found
02 Supported file formats are explicitboundaryapinegativetest
Proves
BR-CAP-PFM-DJE-014-02
Preconditions
Prepare gzipped CSV, plain JSON document and zip input.
Steps
[ { "do": "Attempt file submission.", "expect": "CSV is read through its header and unsupported formats are refused.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#reads a gzipped CSV through its header, which is the other shape a producer exports" } ]
Expected
CSV is read through its header and unsupported formats are refused.
Data
Files in the specified formats.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#reads a gzipped CSV through its header, which is the other shape a producer exports
03 Chunk targets yield to atomic groupsedgeunittest
Proves
BR-CAP-PFM-DJE-014-03
Preconditions
Supply grouped and ungrouped lines of different sizes.
Steps
[ { "do": "Plan chunk boundaries.", "expect": "Limits close eligible chunks, but oversized first records and groups already present can exceed targets.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/chunk-plan.spec.ts#closes the chunk when one more item would pass the item limit" } ]
Expected
Limits close eligible chunks, but oversized first records and groups already present can exceed targets.
Data
No additional fixture is needed.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/chunk-plan.spec.ts#closes the chunk when one more item would pass the item limit
04 Malformed input is line-specific until the file guard tripsfailureapinegativetest
Proves
BR-CAP-PFM-DJE-014-04
Preconditions
Prepare a thousand-line file with three bad lines and a mostly malformed file.
Steps
[ { "do": "Process both.", "expect": "The first reports 997 applications and three numbered refusals; the second fails.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#reads a thousand-line file into chunks, applies 997 records and rejects three lines by their line number" } ]
Expected
The first reports 997 applications and three numbered refusals; the second fails.
Data
The two input files.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#reads a thousand-line file into chunks, applies 997 records and rejects three lines by their line number
05 Admission observes all remaining budgetsruleapitest
Proves
BR-CAP-PFM-DJE-014-05
Preconditions
Prepare competing jobs in two workspaces.
Steps
[ { "do": "Request admission.", "expect": "Total admitted work stays within the budget and the fixture shares room across workspaces.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#hands over no more batches at once than the budget allows" } ]
Expected
Total admitted work stays within the budget and the fixture shares room across workspaces.
Data
Competing-job fixtures.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#hands over no more batches at once than the budget allows
06 Admission priority and rotation prevent unfair grantsconcurrencyunittest
Proves
BR-CAP-PFM-DJE-014-06
Preconditions
Prepare waiting jobs across workspaces with varied ages.
Steps
[ { "do": "Calculate admission grants.", "expect": "Grants rotate by workspace rather than number of jobs and prioritize the starved job.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/admission-planner.spec.ts#gives the slots in turn to each tenant with batches waiting" } ]
Expected
Grants rotate by workspace rather than number of jobs and prioritize the starved job.
Data
No additional fixture is needed.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/admission-planner.spec.ts#gives the slots in turn to each tenant with batches waiting
07 Stalled blocking work produces a failurefailureapinegativetest
Proves
BR-CAP-PFM-DJE-014-07
Preconditions
Hold the admission ceiling with batches that never advance and configure a ten-minute stall interval.
Steps
[ { "do": "Continue admission attempts beyond the configured ten-minute interval.", "expect": "The job fails as stalled and identifies the blocking ceiling.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#fails a job whose ceiling has been held by work that is not moving, rather than waiting for room for ever" } ]
Expected
The job fails as stalled and identifies the blocking ceiling.
Data
A fixture-controlled clock.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#fails a job whose ceiling has been held by work that is not moving, rather than waiting for room for ever
08 Pausing releases admission roomtransitionapitest
Proves
BR-CAP-PFM-DJE-014-08
Preconditions
Pause a job occupying its workspace ceiling.
Steps
[ { "do": "Request admission for another job.", "expect": "The waiting job receives available room.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#admits the next job when the one holding the tenant’s ceiling has been paused, because a paused batch is not in flight" } ]
Expected
The waiting job receives available room.
Data
No additional fixture is needed.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#admits the next job when the one holding the tenant’s ceiling has been paused, because a paused batch is not in flight
09 Distant and resumed group repeats expose the current grouping limitinvariantapinegativeproposed
Proves
BR-CAP-PFM-DJE-014-11
Preconditions
Prepare a file with one group repeated immediately, after two closed chunks, and after a source-reader checkpoint.
Steps
[ { "do": "Read the file through each placement and inspect refused lines and planned groups.", "expect": "The immediate repeat is refused; distant and resumed repeats can enter separate chunks, exposing the bounded detection limit.", "provenance": "proposed", "source": "macroservice-libraries:packages/data-jobs/src/chunk-source.ts:closedGroupKeys" } ]
Expected
The immediate repeat is refused; distant and resumed repeats can enter separate chunks, exposing the bounded detection limit.
Data
Prepare a file with one group repeated immediately, after two closed chunks, and after a source-reader checkpoint.
Source
macroservice-libraries:packages/data-jobs/src/chunk-source.ts:closedGroupKeys
10 Only a completed workspace upload supplies file workinteractionapinegativeproposed
Proves
BR-CAP-PFM-DJE-011-07 BR-CAP-PFM-DJE-011-09 BR-CAP-PFM-DJE-014-01
Preconditions
Create open, completed and foreign-workspace upload sessions.
Steps
[ { "do": "Submit equivalent file jobs against each session and process the accepted job.", "expect": "Only the completed local session supplies input; unavailable sessions create no processing work and foreign input is concealed.", "provenance": "proposed", "source": "services-platform:modules/data-jobs/tests/integration/services/uploads/upload-sessions.integration.spec.js#refuses to abort a completed session, whose object a job may already be reading; services-platform:modules/data-jobs/tests/integration/services/uploads/upload-sessions.integration.spec.js#refuses to complete another tenant’s session, and makes no S3 call for it; services-platform:modules/data-jobs/services/uploads/upload-sessions.ts:presignUploadParts; services-crm:modules/data-jobs/tests/e2e/bulk-data-jobs.e2e.spec.js#refuses an upload id of no upload at all in the same words, so neither answer tells a caller whose it is" } ]
Expected
Only the completed local session supplies input; unavailable sessions create no processing work and foreign input is concealed.
Data
Create open, completed and foreign-workspace upload sessions.
Source
services-platform:modules/data-jobs/tests/integration/services/uploads/upload-sessions.integration.spec.js#refuses to abort a completed session, whose object a job may already be reading; services-platform:modules/data-jobs/tests/integration/services/uploads/upload-sessions.integration.spec.js#refuses to complete another tenant’s session, and makes no S3 call for it; services-platform:modules/data-jobs/services/uploads/upload-sessions.ts:presignUploadParts; services-crm:modules/data-jobs/tests/e2e/bulk-data-jobs.e2e.spec.js#refuses an upload id of no upload at all in the same words, so neither answer tells a caller whose it is
11 File processing preserves keyed replay outcomesinteractionapiproposed
Proves
BR-CAP-PFM-DJE-012-02 BR-CAP-PFM-DJE-012-03 BR-CAP-PFM-DJE-014-03 BR-CAP-PFM-DJE-014-10
Preconditions
Prepare a multi-chunk revisioned JSON Lines file.
Steps
[ { "do": "Process it, redeliver a committed chunk, then submit the same file as another keyed import.", "expect": "Chunk redelivery creates no repeated writes and the second import reports duplicate outcomes for applied revisions.", "provenance": "proposed", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#skips a delivery a newer one has overtaken, so a late file never undoes the current record; macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#writes no crosswalk row for an item it refused, so the corrected delivery of that key is a create; macroservice-libraries:packages/data-jobs/src/chunk-plan.ts:shouldCloseChunk; macroservice-libraries:packages/data-jobs/src/chunk-source.ts:ChunkRun; services-crm:docs/data-jobs.md#The bulk lane" } ]
Expected
Chunk redelivery creates no repeated writes and the second import reports duplicate outcomes for applied revisions.
Data
Prepare a multi-chunk revisioned JSON Lines file.
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#skips a delivery a newer one has overtaken, so a late file never undoes the current record; macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#writes no crosswalk row for an item it refused, so the corrected delivery of that key is a create; macroservice-libraries:packages/data-jobs/src/chunk-plan.ts:shouldCloseChunk; macroservice-libraries:packages/data-jobs/src/chunk-source.ts:ChunkRun; services-crm:docs/data-jobs.md#The bulk lane
12 A critical protection factor holds admission without stalled failureinteractionapinegativeproposed
Proves
BR-CAP-PFM-DJE-014-05 BR-CAP-PFM-DJE-014-07 BR-CAP-PFM-DJE-019-03
Preconditions
Prepare a file job with waiting batches and a readable capacity factor of zero.
Steps
[ { "do": "Attempt admission beyond fifteen minutes, then publish normal capacity and attempt it again.", "expect": "Zero capacity holds the job without a stalled failure; restored capacity admits work within the remaining ceilings.", "provenance": "proposed", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#hands over no more batches at once than the budget allows; macroservice-libraries:packages/data-jobs/src/admission-budget.ts:tenantBulkCeiling; macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#fails a job whose ceiling has been held by work that is not moving, rather than waiting for room for ever; services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#stops bulk and quarters heavy in critical, keeping writes and reads whole" } ]
Expected
Zero capacity holds the job without a stalled failure; restored capacity admits work within the remaining ceilings.
Data
Prepare a file job with waiting batches and a readable capacity factor of zero.
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#hands over no more batches at once than the budget allows; macroservice-libraries:packages/data-jobs/src/admission-budget.ts:tenantBulkCeiling; macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#fails a job whose ceiling has been held by work that is not moving, rather than waiting for room for ever; services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#stops bulk and quarters heavy in critical, keeping writes and reads whole

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.