Skip to content

ATS-CRM-REG-012Monitor recalculation and recover from failure: Acceptance Test Set

Markdown

ATS-CRM-REG-012

Monitor recalculation and recover from failure: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-CRM-REG-012

KindAcceptance test setProduct areaCRMModuleRegionsRevision2

Read atservices-crm a8d1364freact-console baf6dae3

Test Scenarios

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

01 History and individual reads expose progressapitest
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
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
services-crm:modules/regions/tests/integration/services/persistence/region-recalculations.queries.integration.spec.js#listRegionRecalculations › answers at most the limit it was given, taking the newest runs
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 completionapinegativetest
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 reasonsapitest
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
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-recalculation-errors.integration.spec.js#the reason it records › records the redacted reason on a run it leaves running, so the next delivery can get past the cause
services-crm:modules/regions/tests/integration/services/region-assignment/region-recalculation-errors.integration.spec.js#the reason it records › records no value of the batch that failed: not the contact, the tenant, the statement or its parameters
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 runapitest
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 and the final failure marks the run failed.
Data
An injected assignment failure.
Bound to
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-recalculation-errors.integration.spec.js#the last delivery of a run’s event › fails the run, because nothing will deliver its event again
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 reasonapitest
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
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
services-crm:modules/regions/tests/integration/services/region-assignment/region-recalculation-errors.integration.spec.js#a run that gets past what stopped it › clears the column itself, as the table holds it
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 workspacesapinegativetest
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
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
services-crm:modules/regions/tests/e2e/regions.e2e.spec.js#answers 404 for a recalculation the tenant does not have
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

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.