Skip to content

ATS-PFM-OPS-004Recover or deliberately stop background work: Capability Test Specification

Markdown

ATS-PFM-OPS-004

Recover or deliberately stop background work: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-PFM-OPS-004

Design

Executed by
TST-PFM-OPS-003, TST-PFM-OPS-005, TST-PFM-OPS-054

KindAcceptance test setProduct areaPlatformModuleOperational RecordsRevision2

Read atservices-platform ad3f6a65macroservice-libraries 54536a44react-console baf6dae3

Coverage

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

Test Scenarios

11 scenarios proving CAP-PFM-OPS-004; 6 bound to an existing test.

01 Restrict retry creationvalidationunitnegativetest
Proves
BR-CAP-PFM-OPS-004-01 INV-DOM-PFM-OPS-001-10
Preconditions
Running, nonretryable failed and retryable failed jobs exist.
Steps
Request a retry for each.
Expected
The first two requests fail and the last creates a linked job.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses to create a retry of a kind that is not retryable
02 Carry completed work into retryruleunitproposed
Proves
BR-CAP-PFM-OPS-004-02
Preconditions
A failed job completed its first three steps.
Steps
Create and start a retry.
Expected
The copied completion keys let execution continue without repeating those steps.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#answers the steps the prior job completed, which the start carries into the new execution
03 Reject invalid cancellation requestsvalidationunitnegativetest
Proves
BR-CAP-PFM-OPS-004-04
Preconditions
Noncancellable and final jobs exist and another request lacks a reason.
Steps
Ask the engine to cancel each case.
Expected
Every invalid cancellation is refused.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-cancellation.spec.ts#refuses a job whose type is not cancellable
04 Commit the stop request firsttransitionunittest
Proves
BR-CAP-PFM-OPS-004-05
Preconditions
A cancellable job is running and another has not started.
Steps
Cancel each and repeat the requests.
Expected
History precedes execution stop, the unstarted job settles cancelled and repeated requests add nothing.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-cancellation.spec.ts#records the request on the root and in its history, then stops the execution with the cause
05 Distinguish requested from accidental aborttransitionunittest
Proves
BR-CAP-PFM-OPS-004-06
Preconditions
Two executions abort, only one after a recorded cancellation request.
Steps
Reconcile both.
Expected
The requested abort settles cancelled without a business failure consequence; the other fails normally.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-cancellation.spec.ts#settles an execution aborted on request as cancelled, applying no failure consequence
06 Confirm provisioning recovery in HQpermissionbrowsertest
Proves
BR-CAP-PFM-OPS-004-08
Preconditions
Staff have retry authority and a failed workspace-provisioning job.
Steps
Open the detail page and confirm Retry Provisioning.
Expected
With the mocked service response, confirmation changes the page to the returned running attempt; the browser check does not establish the backend provisioning permission.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
react-console:e2e/mock/hq-ops.mock.spec.ts#shows a failed job's reason and retries its provisioning
07 Preserve the retry’s predecessorinvariantunittest
Proves
AS-JNY-PFM-OPS-002-03
Preconditions
A retryable job has failed after completing steps.
Steps
Create a new retry record.
Expected
The record links to its predecessor and preserves completed step keys.
Data
Controlled records and caller contexts matching this scenario’s preconditions.
Bound to
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#creates the retry with lineage to the prior job
08 Confirm recovery from the inspected failureinteractionapiproposed
Proves
BR-CAP-PFM-OPS-004-08 BR-CAP-PFM-OPS-006-06
Preconditions
Staff can inspect a failed provisioning run and hold both required action permissions.
Steps
Open the failure, confirm retry, and inspect the successor.
Expected
The page follows the newly started attempt while the earlier failure remains inspectable.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
react-console:e2e/mock/hq-ops.mock.spec.ts#shows a failed job's reason and retries its provisioning; react-console:e2e/mock/hq-ops.mock.spec.ts#shows a running job's step, its timeline and its event log; CAP-PFM-OPS-006; WF-PFM-OPS-003; WF-PFM-OPS-005; WF-PFM-OPS-006
09 Retain lifecycle failure evidenceinteractionapiproposed
Proves
BR-CAP-PFM-OPS-004-01
Preconditions
A workspace lifecycle run reaches an interrupted execution outcome.
Steps
Reconcile it and inspect the lifecycle record alongside the job record.
Expected
Both records identify the failed work without silently reopening its final history.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses to create a retry of a kind that is not retryable; CAP-PFM-SEC-003; WF-PFM-OPS-003; WF-PFM-OPS-005; WF-PFM-OPS-006
10 Preserve retirement scopeinteractionapiproposed
Proves
BR-CAP-PFM-OPS-004-01
Preconditions
A workspace is deleting and its deletion jobs must remain inspectable.
Steps
Purge operational resources and inspect the retained deletion runs.
Expected
Retirement removes owned resources while its retained work still explains the deletion.
Data
Isolated workspace records and caller contexts for both sides of the interaction.
Source
macroservice-libraries:packages/jobs/src/engine/job-engine.spec.ts#refuses to create a retry of a kind that is not retryable; CAP-PFM-SEC-004; WF-PFM-OPS-003; WF-PFM-OPS-005; WF-PFM-OPS-006
11 Distinguish requester evidence after requested and accidental abortinteractionapinegativeproposed
Proves
BR-CAP-PFM-OPS-004-06 BR-CAP-PFM-OPS-003-06
Preconditions
Separate stale provisioning runs abort, with only one carrying a recorded stop request.
Steps
Reconcile both runs and inspect the declared failure consequence and requester evidence.
Expected
The accidental abort follows its failure consequence and requester explanation; the requested stop retains cancellation evidence without invoking that consequence.
Data
Isolated workspace and run-owned lifecycle records, with a second linked workspace where shared company evidence is checked.
Source
services-platform:modules/jobs/aws/logic/jobs-reconciler.lambda.ts:createJobsReconcilerFunction; macroservice-libraries:packages/jobs/src/reconciler/job-reconciler.ts:handleCandidate; services-platform:modules/jobs/tests/integration/lifecycle/job-reconciliation/job-reconciliation.integration.spec.js#halts the job only on the third pass; macroservice-libraries:packages/jobs/src/reconciler/job-reconciler.ts:settleFromReconciliation; services-platform:modules/jobs/tests/integration/lifecycle/job-reconciliation/job-reconciliation.integration.spec.js#corrects the job to failed, never succeeded, keeping the progress its steps earned; services-platform:modules/jobs/tests/integration/lifecycle/job-reconciliation/job-reconciliation.integration.spec.js#raises one alert and changes nothing; services-platform:modules/jobs/aws/lambda/RECONCILER.handler.ts:handler; services-platform:modules/jobs/aws/lambda/RECONCILER.handler.ts:handler

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.