Skip to content

ATS-PFM-DJE-004Interrupt a job and recover its unfinished work: Capability Test Specification

Markdown

ATS-PFM-DJE-004

Interrupt a job and recover its unfinished work: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaPlatformModuleData Job EngineRevision2

Read atmacroservice-libraries 54536a44services-crm a8d1364freact-console baf6dae3

Coverage

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

Test Scenarios

10 scenarios proving CAP-PFM-DJE-004; 6 bound to an existing test.

01 Final-state transitions are constrainedtransitionunitnegativetest
Proves
BR-CAP-PFM-DJE-004-01
Preconditions
Use the declared state transition model.
Steps
[ { "do": "Check outgoing transitions from every final state.", "expect": "Only the allowed blocked-item retry can leave a completed state.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/data-job-states.spec.ts#leaves every final state with nowhere to go, but for the retry of blocked items the plan allows" } ]
Expected
Only the allowed blocked-item retry can leave a completed state.
Data
No additional fixture is needed.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/data-job-states.spec.ts#leaves every final state with nowhere to go, but for the retry of blocked items the plan allows
02 Cancellation waits for work already in flightconcurrencyapitest
Proves
BR-CAP-PFM-DJE-004-02
Preconditions
Start a job with an executing batch.
Steps
[ { "do": "Request cancellation during processing.", "expect": "The batch settles, further work stops, and cancelled totals include unattempted items.", "provenance": "test", "source": "services-crm:modules/data-jobs/tests/integration/services/jobs/contact-data-jobs.integration.spec.js#ends the job cancelled, not failed, once the batch it waited for has finished" } ]
Expected
The batch settles, further work stops, and cancelled totals include unattempted items.
Data
A collection of 500 contacts.
Bound to
Source
services-crm:modules/data-jobs/tests/integration/services/jobs/contact-data-jobs.integration.spec.js#ends the job cancelled, not failed, once the batch it waited for has finished
03 Resume recovers a paused file jobtransitionapitest
Proves
BR-CAP-PFM-DJE-004-03
Preconditions
Pause a file job before its source is read.
Steps
[ { "do": "Resume its processing.", "expect": "The job proceeds to completion.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#holds a job paused before its source was read, and runs it to the end once resumed" } ]
Expected
The job proceeds to completion.
Data
A short input file.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#holds a job paused before its source was read, and runs it to the end once resumed
04 Retry recovers dependencies but refuses invalid inputedgeapinegativetest
Proves
BR-CAP-PFM-DJE-004-04
Preconditions
Prepare a completed job with blocked children and another with rejections.
Steps
[ { "do": "Load the missing parent and retry each job.", "expect": "The children apply; the rejection-only job refuses retry.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#blocks the child, and a retry after the parent is loaded applies it and finishes the job" } ]
Expected
The children apply; the rejection-only job refuses retry.
Data
Parent and dependent input files.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#blocks the child, and a retry after the parent is loaded applies it and finishes the job
05 Applied rollback prevents retryinteractionapinegativetest
Proves
BR-CAP-PFM-DJE-004-05
Preconditions
Prepare a job with blocked items and an applied rollback.
Steps
[ { "do": "Invoke retry on the original job.", "expect": "The service refuses retry after rollback.", "provenance": "test", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses to retry a job that has been rolled back, so its blocked rows are not written after the undo" } ]
Expected
The service refuses retry after rollback.
Data
No additional fixture is needed.
Bound to
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses to retry a job that has been rolled back, so its blocked rows are not written after the undo
06 Unauthorized users cannot control a jobpermissionbrowsernegativeproposed
Proves
BR-CAP-PFM-DJE-004-06
Preconditions
Use read-only, ordinary-user and administrator-without-bulk personas.
Steps
[ { "do": "Inspect Data Imports and attempt job controls under each identity.", "expect": "The controls are absent and backend calls are refused.", "provenance": "proposed", "source": "react-console:acceptance/crm/playwright/journeys/data-operations/CRM-ACC-0664.spec.ts#CRM-ACC-0664" } ]
Expected
The controls are absent and backend calls are refused.
Data
The specified permission personas.
Source
react-console:acceptance/crm/playwright/journeys/data-operations/CRM-ACC-0664.spec.ts#CRM-ACC-0664
07 Workflow failure settles durable job statefailureapinegativetest
Proves
BR-CAP-PFM-DJE-004-07
Preconditions
Prepare a file job whose workflow failed after partial admission.
Steps
[ { "do": "Invoke failure handling twice.", "expect": "The first call fails the job and abandons unstarted work; the repeat adds no changes.", "provenance": "test", "source": "services-crm:modules/data-jobs/tests/integration/services/jobs/bulk-data-job-failure.integration.spec.js#fails the data job, so its status read answers failed and a Data Run polling it stops" } ]
Expected
The first call fails the job and abandons unstarted work; the repeat adds no changes.
Data
No additional fixture is needed.
Bound to
Source
services-crm:modules/data-jobs/tests/integration/services/jobs/bulk-data-job-failure.integration.spec.js#fails the data job, so its status read answers failed and a Data Run polling it stops
08 Cancellation accounts for settled and abandoned workinteractionapiproposed
Proves
BR-CAP-PFM-DJE-003-01 BR-CAP-PFM-DJE-004-02
Preconditions
Prepare a multi-batch job and hold one batch in flight.
Steps
[ { "do": "Cancel while that batch is active, let it settle, and inspect receipts and unattempted positions.", "expect": "The active batch may commit once; later batches do not start and the job settles cancelled with unattempted work counted.", "provenance": "proposed", "source": "services-crm:modules/data-jobs/tests/integration/services/queue/data-job-worker.integration.spec.js#changes each contact once between them, whichever delivery got there first; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-data-jobs.integration.spec.js#ends the job cancelled, not failed, once the batch it waited for has finished" } ]
Expected
The active batch may commit once; later batches do not start and the job settles cancelled with unattempted work counted.
Data
Prepare a multi-batch job and hold one batch in flight.
Source
services-crm:modules/data-jobs/tests/integration/services/queue/data-job-worker.integration.spec.js#changes each contact once between them, whichever delivery got there first; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-data-jobs.integration.spec.js#ends the job cancelled, not failed, once the batch it waited for has finished
09 Applied restoration prevents reopening original blocked workinteractionapiproposed
Proves
BR-CAP-PFM-DJE-004-05 BR-CAP-PFM-DJE-008-01 BR-CAP-PFM-DJE-008-09
Preconditions
Finish an update with reversible changes and blocked input.
Steps
[ { "do": "Plan a restoration, verify planning alone leaves retry available, apply the restoration, and attempt retry of the original.", "expect": "Only application of restoration prevents later retry; restored values stay intact.", "provenance": "proposed", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses to retry a job that has been rolled back, so its blocked rows are not written after the undo; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans it already validated, because planning a rollback IS validating it; macroservice-libraries:packages/data-jobs/README.md#Rolling a job back" } ]
Expected
Only application of restoration prevents later retry; restored values stay intact.
Data
Finish an update with reversible changes and blocked input.
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses to retry a job that has been rolled back, so its blocked rows are not written after the undo; services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans it already validated, because planning a rollback IS validating it; macroservice-libraries:packages/data-jobs/README.md#Rolling a job back
10 Dependency arrival makes retained input retryableinteractionapiproposed
Proves
BR-CAP-PFM-DJE-004-04 BR-CAP-PFM-DJE-012-04
Preconditions
Load a child whose required parent key is absent.
Steps
[ { "do": "Inspect the blocked result, load the parent, and retry the child job without another upload.", "expect": "The retained child input applies after its parent exists without duplicating earlier successful writes.", "provenance": "proposed", "source": "macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#refuses to retry a job whose refusals are not blocked items, because correcting records is a new job; macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#blocks the child, and a retry after the parent is loaded applies it and finishes the job" } ]
Expected
The retained child input applies after its parent exists without duplicating earlier successful writes.
Data
Load a child whose required parent key is absent.
Source
macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#refuses to retry a job whose refusals are not blocked items, because correcting records is a new job; macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#blocks the child, and a retry after the parent is loaded applies it and finishes the job

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.