Skip to content

test(ledger): synchronize concurrent recovery fixtures - #8029

Merged
bokelley merged 2 commits into
mainfrom
fix/ledger-recovery-ci
Oct 9, 2026
Merged

bokelley merged 2 commits into
mainfrom
fix/ledger-recovery-ci

Conversation

@bokelley

@bokelley bokelley commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

The concurrent provider-intent recovery test can hit the production 250 ms lock deadline while another recovery performs its deferred commit checks. This reproduces the integration failure blocking #8021: the test receives persistence_uncertain instead of its required unknown_exposure result.

Synchronize the test with two independent PostgreSQL connections: hold the first recovery at the table gate, verify the second connection is blocked by that backend in pg_stat_activity, then release the first. Use the same test-only timeout approach as the adjacent lock-ordering tests. The production timeouts and separate production lock-failure assertions remain unchanged.

Also derive deterministic attempt fixture IDs from each authorization digest. Tests that commit immutable attempts can now run again against the retained database without colliding with an earlier run. No database reset or broad cleanup is added. This PR changes one integration test file; no protocol changeset is required.

Validation:

  • Complete integration file: 37 passed twice on the same retained PostgreSQL 16.15 database, with no filtering or reset.
  • Actual normal commit hook: 72 root test files / 1,106 tests passed; boundary guards and both typechecks passed. The stock server-unit selector skipped because this PR has no server-unit changes.
  • Actual normal push hook: version and changeset scope checks passed; stock documentation and storyboard checks skipped because their paths did not change.
  • The initial commit hook failure from missing sparse-checkout runtime snapshots is preserved. All 117,396 committed artifact files were restored from Git and verified before the successful hook; no release assets were rebuilt.

Review follow-up on final head 34cf48ed64c0c64d2348db8fcd81389ca8fc4501: the two test-only transaction timeouts now match the adjacent 15-second ordering test, leaving headroom beyond the unchanged 5-second database observation window. Production deadlines and the independent lock-failure regression are unchanged. The complete file passed all 37 tests again on the retained PostgreSQL database; actual normal commit/push hooks passed with 1,106 root tests, guards and both typechecks. The stock server-unit and documentation/storyboard selectors skipped unchanged path groups. Fresh service CI and review are required on this head; the previous automated approval applies to the older head.

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Oct 8, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — test-only PR with 1 medium finding (falls through to row 9).

What I checked:

  • Single integration test file changed (94/38), no protocol surface, schema, docs, dist artifact, or migration touched — no changeset required, correctly stated.
  • fixtureAttemptId now derives attempt IDs from a per-run-unique authorization digest (sha256(randomUUID())), fixing cross-run collisions; consistent with insertIntent's suffix handling.
  • Rewritten concurrent-recovery test correctly gates the standalone recovery's SHARE ROW EXCLUSIVE lock and asserts the intent's internal recovery is blocked via pg_blocking_pids; lock ordering and unknown_exposure terminal expectation match the production ledger paths.

Medium findings:

  • server/tests/integration/addie/fixed-trace-component-smoke-private-ledger-migration.test.ts:439 — Provider-intent lock_timeout (5s) equals observation poll budget (5s), leaving a tail-risk flakiness window on the persistence_uncertain path this PR fixes.

Only 1 medium finding, no critical/high, no escalation triggers (high_risk false, gated_paths false, not a schema/data-loss/infra category), no team gate. Rows 1–8 do not fire; row 9 applies. The lock_timeout tightness is worth a look from the author but is a test-flakiness concern, not a blocker.

Medium findings

  • server/tests/integration/addie/fixed-trace-component-smoke-private-ledger-migration.test.ts:439 — Provider-intent lock_timeout (5s) equals observation poll budget (5s)

@bokelley bokelley added the ladon/force-review Force Ladon to review the next eligible PR event label Oct 9, 2026 — with conductor.build App

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — test-only change, no blocking findings.

This PR modifies a single integration test file (server/tests/integration/addie/fixed-trace-component-smoke-private-ledger-migration.test.ts). The prior Medium finding (provider-intent lock_timeout 5s == observation poll budget 5s) has been resolved: the rewritten concurrent-recovery test now intercepts SET LOCAL lock_timeout/statement_timeout to force 15s while the expect.poll window stays at 5s, giving real headroom. The reviewer verified the gate string matches recordUnknownExposure's LOCK TABLE ... SHARE ROW EXCLUSIVE, the two-backend pool (max 2) cannot deadlock, and fixtureAttemptId now keys to a run-unique authorizationDigest to fix cross-run collisions.

No current findings. Not a protocol-surface, schema, docs, dist artifact, or migration change — no changeset/spec/immutability gates apply. high_risk is false, gated_paths is false, and no no-auto-approve team match. The prior approve stands with the earlier medium now fixed.

@bokelley
bokelley merged commit dc8685e into main Oct 9, 2026
31 checks passed
@bokelley
bokelley deleted the fix/ledger-recovery-ci branch October 9, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/force-review Force Ladon to review the next eligible PR event

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant