Skip to content

ATS-PFM-DJE-019Control capacity protection during database pressure: Capability Test Specification

Markdown

ATS-PFM-DJE-019

Control capacity protection during database pressure: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaPlatformModuleData Job EngineRevision2

Read atservices-platform ad3f6a65macroservice-libraries 54536a44

Coverage

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

Test Scenarios

11 scenarios proving CAP-PFM-DJE-019; 8 bound to an existing test.

01 Pressure classification follows strict thresholdsboundaryunittest
Proves
BR-CAP-PFM-DJE-019-01
Preconditions
Supply literal signal readings.
Steps
[ { "do": "Evaluate their pressure levels.", "expect": "Strictly exceeding configured thresholds produces the corresponding level; an API without a baseline is not classified by latency.", "provenance": "test", "source": "services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#is constrained when ACU utilization is above 80 %" } ]
Expected
Strictly exceeding configured thresholds produces the corresponding level; an API without a baseline is not classified by latency.
Data
No additional fixture is needed.
Bound to
Source
services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#is constrained when ACU utilization is above 80 %
02 Consistent readings and spacing govern transitionstransitionunittest
Proves
BR-CAP-PFM-DJE-019-02
Preconditions
Prepare alternating and sustained reading sequences.
Steps
[ { "do": "Evaluate sequential state decisions.", "expect": "Three supporting readings permit escalation, the spacing interval prevents another immediate transition and scaling alone remains constrained.", "provenance": "test", "source": "services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#enters constrained on three constrained readings in a row" } ]
Expected
Three supporting readings permit escalation, the spacing interval prevents another immediate transition and scaling alone remains constrained.
Data
No additional fixture is needed.
Bound to
Source
services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#enters constrained on three constrained readings in a row
03 Protection states supply their declared factorsruleunittest
Proves
BR-CAP-PFM-DJE-019-03
Preconditions
Prepare each capacity state.
Steps
[ { "do": "Inspect its workload factors.", "expect": "Constrained halves bulk and heavy; critical stops bulk and quarters heavy while leaving ordinary factors unchanged.", "provenance": "test", "source": "services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#halves bulk and heavy in constrained and arms the read ceiling" } ]
Expected
Constrained halves bulk and heavy; critical stops bulk and quarters heavy while leaving ordinary factors unchanged.
Data
No additional fixture is needed.
Bound to
Source
services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#halves bulk and heavy in constrained and arms the read ceiling
04 Capacity management is staff-only and permissionedpermissionapinegativetest
Proves
BR-CAP-PFM-DJE-019-04
Preconditions
Use a staff caller holding another HQ key and a customer administrator.
Steps
[ { "do": "Attempt a pin mutation as the staff caller and a pin read as the customer administrator.", "expect": "Both requests receive a forbidden response.", "provenance": "test", "source": "services-platform:modules/capacity/tests/e2e/capacity-pins.e2e.spec.js#refuses a staff member who holds only another HQ key" } ]
Expected
Both requests receive a forbidden response.
Data
Permission personas.
Bound to
Source
services-platform:modules/capacity/tests/e2e/capacity-pins.e2e.spec.js#refuses a staff member who holds only another HQ key
05 Invalid pins preserve the stored overridevalidationapinegativetest
Proves
BR-CAP-PFM-DJE-019-05
Preconditions
Prepare a stored pin.
Steps
[ { "do": "Send unknown states, blank reasons and invalid expiry times.", "expect": "Each refusal identifies its field and leaves the pin intact.", "provenance": "test", "source": "services-platform:modules/capacity/tests/integration/services/persistence/capacity-state-pins.integration.spec.js#refuses a state that is not one of the four, naming state" } ]
Expected
Each refusal identifies its field and leaves the pin intact.
Data
No additional fixture is needed.
Bound to
Source
services-platform:modules/capacity/tests/integration/services/persistence/capacity-state-pins.integration.spec.js#refuses a state that is not one of the four, naming state
06 Pin changes have audit attributioninvariantapitest
Proves
BR-CAP-PFM-DJE-019-06
Preconditions
No existing pin is required.
Steps
[ { "do": "Create and release a pin.", "expect": "Both audit entries describe before and after values.", "provenance": "test", "source": "services-platform:modules/capacity/tests/integration/services/pins/capacity-pins.integration.spec.js#records the pin and its removal, each with what it was and what it became" } ]
Expected
Both audit entries describe before and after values.
Data
No additional fixture is needed.
Bound to
Source
services-platform:modules/capacity/tests/integration/services/pins/capacity-pins.integration.spec.js#records the pin and its removal, each with what it was and what it became
07 Sustained emergency respects the throttle switchfailureunittest
Proves
BR-CAP-PFM-DJE-019-07
Preconditions
Prepare switch-off and switch-on cases, prolonged emergency and recovery.
Steps
[ { "do": "Evaluate decisions and apply stage changes.", "expect": "Disabled throttling makes no gateway call; enabled prolonged emergency changes declared values and recovery restores them.", "provenance": "test", "source": "services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#applies the stage throttles after five further minutes of emergency without relief" } ]
Expected
Disabled throttling makes no gateway call; enabled prolonged emergency changes declared values and recovery restores them.
Data
Gateway and signal test doubles.
Bound to
Source
services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#applies the stage throttles after five further minutes of emergency without relief
08 Consecutive signal failures restore the normal statefailureunittest
Proves
BR-CAP-PFM-DJE-019-08
Preconditions
Prepare previous critical state without a pin and failed signal reads.
Steps
[ { "do": "Evaluate the first and second failed ticks.", "expect": "The first holds critical and the second returns normal.", "provenance": "test", "source": "services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#keeps the previous state for one tick" } ]
Expected
The first holds critical and the second returns normal.
Data
A signal test double.
Bound to
Source
services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#keeps the previous state for one tick
09 One publication failure leaves the other channel usablefailureapinegativeproposed
Proves
BR-CAP-PFM-DJE-019-09
Preconditions
Prepare a decided critical state and independent cache and parameter clients.
Steps
[ { "do": "Fail each publication channel in turn, then fail both.", "expect": "One failed channel leaves the other carrying the decision; failure of both makes the invocation fail.", "provenance": "proposed", "source": "services-platform:docs/workload-governance.md#Capacity sentinel" } ]
Expected
One failed channel leaves the other carrying the decision; failure of both makes the invocation fail.
Data
Prepare a decided critical state and independent cache and parameter clients.
Source
services-platform:docs/workload-governance.md#Capacity sentinel
10 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
11 Capacity protection does not gate scheduled partition maintenanceinteractionapinegativeproposed
Proves
BR-CAP-PFM-DJE-019-03 BR-CAP-PFM-DJE-020-01 BR-CAP-PFM-DJE-020-04
Preconditions
Prepare critical capacity and registered history tables, including one failing table.
Steps
[ { "do": "Keep bulk admission held while running the scheduled maintenance pass.", "expect": "History maintenance still prepares eligible storage and reports its failing table; it does not consume bulk admission slots.", "provenance": "proposed", "source": "services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#stops bulk and quarters heavy in critical, keeping writes and reads whole; services-platform:modules/partitions/tests/integration/services/maintenance/maintain-partitions.integration.spec.js#creates the current month and the two after it on the first run, and drops nothing; services-platform:modules/partitions/aws/logic/partitions-maintenance.schedule.ts:createPartitionsMaintenanceSchedule; services-platform:modules/partitions/tests/integration/services/maintenance/maintain-partitions.integration.spec.js#fails the run as a whole when one table’s pass failed, naming that table" } ]
Expected
History maintenance still prepares eligible storage and reports its failing table; it does not consume bulk admission slots.
Data
Prepare critical capacity and registered history tables, including one failing table.
Source
services-platform:modules/capacity/tests/unit/services/capacity/decide-state.spec.ts#stops bulk and quarters heavy in critical, keeping writes and reads whole; services-platform:modules/partitions/tests/integration/services/maintenance/maintain-partitions.integration.spec.js#creates the current month and the two after it on the first run, and drops nothing; services-platform:modules/partitions/aws/logic/partitions-maintenance.schedule.ts:createPartitionsMaintenanceSchedule; services-platform:modules/partitions/tests/integration/services/maintenance/maintain-partitions.integration.spec.js#fails the run as a whole when one table’s pass failed, naming that table

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.