---
id: TST-PFM-TNL-066
title: Platform removal failure and retry
kind: integration
product_area: platform
module: tenant-lifecycle
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
implements:
  - ATS-PFM-TNL-017-07
  - ATS-PFM-TNL-018-04
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Run-owned target and comparison workspace records in the prepared test database; owner access is limited to
  fixture arrangement, independent inspection and cleanup of those records.
evidence:
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../../customers/services/persistence/customers
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../services/deletion/request-deletion
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../services/deletion/operator-recovery
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../services/deletion/tenant-purge-workflow
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../services/deletion/tenant-purge-workflow
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../db/tenant-purge-jobs.table
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../services/deletion/tenant-purge-operations
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../services/lifecycle/lifecycle-refusals
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../../../services/persistence/tenants
  - >-
    services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js
    imports ../../deletion-support
binding_scope: >-
  Each implements link names a scenario whose retained cited checks all occur in this file. Partial assertions
  for other scenarios remain evidence only.
partial_scenario_evidence:
  - scenario: ATS-PFM-TNL-015-02
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#tells
        the people a deletion that failed was not completed
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-03
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#refuses
        a purge of a tenant that is neither being deleted nor being loaded
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#refuses
        a purge of a tenant other than the one the session is in
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#refuses
        a purge that names no tenant
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-08
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#runs
        every participant again when a row appears after one of them finished, and finishes when it is gone
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#refuses
        to finish, with the counts, when something keeps writing to the tenant
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-10
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#deletes
        the customer with its last tenant when the request asked for it
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#never
        touches the catalog rows the product owns, whatever a customer purge removes
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-017-11
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#completes
        the destruction when a purge that failed part way is retried
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#does
        not run the steps a failed purge had already completed when it is retried
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#leaves
        a retried request untouched when the purge it replaced records its failure afterwards
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
  - scenario: ATS-PFM-TNL-018-06
    references:
      - >-
        services-platform:modules/tenants/tests/integration/services/deletion/tenant-purge-recovery.integration.spec.js#refuses
        to create a tenant again under the id of one that was deleted
    provenance: test
    scope: partial assertions; no complete scenario implementation claimed
---
# Platform removal failure and retry

## Verification Boundary

The suite invokes production lifecycle services or persistence against its test database. Each fixture and directly called participant belongs to the repository named in the register; this is a local integration boundary.

## What This Suite Proves

Removal failure and retry is the inspected subject. The implements links identify scenarios whose cited checks occur in this file. The original test-title references delimit those checks; partial contributions to other combined scenarios remain evidence only.

## What It Does Not Prove

Source inspection supplies no passing run. The suite does not establish console behavior, deployment configuration, complete removal in every application or recovery from a provider failure beyond its declared seams. A local zero inventory covers declared and seeded resources only.

## Real Dependencies and Test Doubles

The local deletion harness runs the production workflow definition, task handler, job engine and Platform persistence. It advances a controlled clock and supplies recording mail, in-memory storage and ledger, remote-application, search and portal-provider seams. These doubles establish orchestration behavior rather than provider removal.

## Must Not Be Doubled

Keep the production service or persistence function and the database constraints, row policies and guarded removal functions under test real. For dispatcher cases, keep route selection and authorization real as well. Provider and remote-application seams must remain explicit and cannot stand in for deployed cross-application qualification.
