Repository navigation
test(ledger): synchronize concurrent recovery fixtures - #8029
Conversation
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
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_uncertaininstead of its requiredunknown_exposureresult.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:
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.