Skip to content

ATS-CRM-REG-012Monitor recalculation and recover from failure: Capability Test Specification

Markdown

ATS-CRM-REG-012

Monitor recalculation and recover from failure: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCRMModuleRegionsRevision3

Read atservices-crm a8d1364freact-console baf6dae3

Coverage

  • Rule covered
  • Transition covered
  • Validation gap: FND-CRM-REG-057
  • Permission gap: FND-CRM-REG-057
  • Edge gap: FND-CRM-REG-057
  • Failure covered
  • Boundary covered
  • Concurrency gap: FND-CRM-REG-057
  • Invariant covered
  • Interaction covered

Test Scenarios

8 scenarios proving CAP-CRM-REG-012; 6 bound to an existing test.

01 History and individual reads expose progressruleapitest
Proves
BR-CAP-CRM-REG-012-01
Preconditions
The workspace has three runs, including equal start times.
Steps
Read history using defaults and a smaller limit, then inspect a run.
Expected
Ordering is newest first with identifier tie breaking, the limit bounds results and the record exposes progress.
Data
Three recalculation history entries.
Bound to
Source
services-crm:modules/regions/tests/integration/services/persistence/region-recalculations.queries.integration.spec.js#listRegionRecalculations › answers the whole record of every run of the tenant, the newest first
02 Status and counters cannot contradict completioninvariantapinegativetest
Proves
BR-CAP-CRM-REG-012-02
Preconditions
A run record exists.
Steps
Attempt completed status before the final phase, final phase without completion and more changed than examined.
Expected
Each inconsistent state is rejected.
Data
A recalculation record.
Bound to
Source
services-crm:modules/regions/tests/integration/services/persistence/region-recalculations.integration.spec.js#refuses completed before the run is done
03 Ordinary failures retain redacted reasonsfailureapitest
Proves
BR-CAP-CRM-REG-012-03
Preconditions
A database failure will interrupt the next batch.
Steps
Make two unsuccessful deliveries.
Expected
Both fail while the run stays running, and its reason excludes bound values, identifiers and SQL text.
Data
A deliberately injected database error.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-recalculation-errors.integration.spec.js#the reason it records › answers the caller the error the batch failed with, so the queue delivers the event again
04 Only final failure terminates the runtransitionapitest
Proves
BR-CAP-CRM-REG-012-04
Preconditions
The unfinished batch continues failing.
Steps
Fail a normal delivery and then the final delivery.
Expected
The earlier failure retains running status; the final failure marks the run failed when failure settlement succeeds.
Data
An injected assignment failure.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-recalculation-errors.integration.spec.js#the reason it records › leaves that run running too: how many failures are enough is the queue’s decision, not the run’s
05 Successful progress removes the failure reasontransitionapitest
Proves
BR-CAP-CRM-REG-012-05
Preconditions
A run retains an earlier failure reason.
Steps
Process its remaining work successfully.
Expected
Completion retains no failure reason.
Data
An unfinished run retaining a previous failure reason.
Bound to
Source
services-crm:modules/regions/tests/integration/services/region-assignment/region-recalculation-errors.integration.spec.js#a run that gets past what stopped it › answers the whole record of the completed run, with no reason left on it
06 Run reads cannot cross workspacesboundaryapinegativetest
Proves
BR-CAP-CRM-REG-012-06
Preconditions
A run belongs to another workspace.
Steps
Read it locally and request an unknown identifier.
Expected
Neither read finds a local run.
Data
Two distinct customer workspaces.
Bound to
Source
services-crm:modules/regions/tests/integration/services/persistence/region-recalculations.queries.integration.spec.js#getRegionRecalculation › answers undefined in another tenant for the first tenant's run
07 Retryable failure and recovery remain visible through run readsinteractionapiproposed
Proves
BR-CAP-CRM-REG-011-04 BR-CAP-CRM-REG-012-03 BR-CAP-CRM-REG-012-05 BR-CAP-CRM-REG-010-02
Preconditions
A run spans more than one batch and its next batch fails once.
Steps
Commit the first batch, fail the next delivery, read the run and policy currency, remove the fault and redeliver to completion.
Expected
Reads retain committed progress and a redacted running error before recovery; successful completion clears that error and covers only its recorded generation.
Data
A run spans more than one batch and its next batch fails once.
Source
WF-CRM-REG-003
08 Failure-settlement failure preserves the original batch errorfailureapinegativeproposed
Proves
INV-DOM-CRM-REG-004-06
Preconditions
A run’s next batch fails and storing its failure reason also fails.
Steps
Deliver once with a recoverable fault and once as final receive while settlement remains unavailable.
Expected
The original batch error is rethrown and settlement failure is logged; final delivery can leave running status rather than guaranteeing failed settlement.
Data
A run’s next batch fails and storing its failure reason also fails.
Source
services-crm:modules/regions/services/region-assignment/region-recalculation.ts:recordFailure

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.