Repository navigation
fix(test): synchronize private ledger lock-order assertions - #7441
Merged
Merged
Conversation
bokelley
enabled auto-merge (squash)
September 13, 2026 11:50
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — test-only fix to a private-ledger lock-order integration test.
Checked:
- Single file changed (+39/-13):
server/tests/integration/addie/fixed-trace-component-smoke-private-ledger-migration.test.ts. No production code, schema (static/schemas/source/**), docs,dist/**artifacts, migrations, or protocol surface touched — so no changeset is required and no schema↔docs / oneOf / immutability concerns apply. - The change correctly replaces a 75 ms sleep that raced the production 250 ms lock timeout with deterministic observation of the writer's table gate, bounds the ordering test's timeouts to 5s, and adds a finally block that drains both transactions even on assertion failure — a net reliability improvement.
Gate checks:
- No no-auto-approve team match.
- gated_paths: false (review_decision REVIEW_REQUIRED is therefore irrelevant to row 2).
- high_risk: false; no deleted/modified sensitive files.
- No critical/high/medium findings.
None of rows 1–8 fire → row 9 approve.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The private-ledger lock-order integration test races recovery against the production 250 ms lock timeout. On a slower runner the writer correctly returns
persistence_uncertain, but the test expects onlyunknown_exposure, blocking unrelated PRs including #7420.Observe the actual writer table-gate query instead of sleeping for 75 ms, assert that the writer has neither acquired the gate nor requested its target row while recovery holds the table lock, and preserve the strict post-recovery result assertion. This ordering test uses bounded five-second database timeouts; the production timeouts and their separate timeout tests are unchanged. Cleanup releases the recovery barrier and drains both transactions even if an assertion fails.
Validation, run directly in Docker with PostgreSQL 16 and the ledger migrations:
origin/main(unknown_exposureexpected,persistence_uncertainreceived).npm run typecheckpassed, including the test-aware fixed-trace check.This changes one integration test. No production code, migration, protocol surface, or changeset is included.