---
id: TST-PFM-INT-542
title: execution settlement
kind: integration
product_area: platform
module: integrations
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: services-platform
files:
  - modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js
implements:
  - ATS-PFM-INT-009-10
  - ATS-PFM-INT-010-05
  - ATS-PFM-INT-011-05
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Use the suite-owned database fixtures and its declared cleanup; prepare the test database before
  integration or lifecycle execution.
evidence:
  - >-
    services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js
test_cases:
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#refuses
      an operator’s retry at ten attempts, not_retryable with the reason attempt_limit and the count
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#queues
      nothing for a retry it refused at the bound
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#still
      retries at nine attempts, the control for the refusal
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#settles
      an execution whose next attempt is the eleventh failed, with the last class and
      retry_exhausted.attempt_limit
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#releases
      the key of the execution it settled at the bound
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#is
      written when the queue consumer settles an async execution
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#is
      not written again by a redelivered queue message
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#is
      written once for two settlements that both read the execution running, the loser moving nothing
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#is
      not written by a second complete, which the callback refuses once the execution is settled
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#is
      written with the error for a failed completion, the adapter’s own
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#is
      not written for a sync execution that settles
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#rolls
      the settlement back with the event when the transaction fails after the move
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#resolve
      of a needs_attention async execution writes the completion with the stored answer
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#resolve
      as failed writes the completion with the operator’s error
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#a
      second resolve of the same execution is refused and writes no second completion
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#a
      second cancel of the same execution is refused and writes no second completion
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#resolve
      of a sync execution the caller was never answered for writes exactly one completion
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#cancel
      of an accepted async execution writes the cancelled completion with conflict.cancelled
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#cancel
      of an accepted sync execution writes no completion
    provenance: test
  - source: >-
      services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js#cancel
      asking a running async execution to stop writes no completion yet
    provenance: test
dependency_evidence:
  provenance: test
  source: >-
    services-platform:modules/integrations/tests/integration/services/executions/execution-settlement.integration.spec.js
  reviewed:
    - Suite introduction
    - Fixture setup
    - Client substitutions
    - Assertions and cleanup
---
# execution settlement

## Verification Boundary

This database and service suite exercises execution settlement. Its registration records the executable definition; no run result is asserted.

## What This Suite Proves

The bindings identify the detailed outcomes asserted by this suite. Test-level evidence retains the individual checks, including cases where several suites contribute to one scenario.

## What It Does Not Prove

In-process execution does not establish deployed infrastructure or a real provider response. Several bindings can supply different parts of a detailed scenario; no single-file completeness is implied.

## Real Dependencies and Test Doubles

The suite definition identifies its database fixtures and replaced clients, hooks, clocks or executors. Integration runs use the prepared database; lifecycle runs exercise the in-process route or adapter path.

## Must Not Be Doubled

The database constraints, transactions and service behavior claimed by an integration binding must execute. Replaced external seams cannot establish live provider or infrastructure behavior.
