Skip to content

Fix the retirement failure test deadline race - #314

Merged
SaladDay merged 1 commit into
mainfrom
codex/retirement-timeout-fix
Sep 30, 2026
Merged

SaladDay merged 1 commit into
mainfrom
codex/retirement-timeout-fix

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

The retirement failure test blocks an owner query and waits for a later cancellation fence to time out. Both operations have the same five-second lease deadline, so the query's own deadline can expire before the fixture releases it. A ten-second outer query context cannot extend that bound.

Give only the fixture's cancellation attempt a shorter caller deadline, still using the real PostgreSQL lease. Preserve admission, lifecycle retention and drain assertions, and verify the lease remains usable after releasing the query. Clear the consumed result before reporting failure so cleanup does not wait for it twice. Production code and deadlines are unchanged.

Validation against an isolated PostgreSQL 16 database on Linux:

  • Baseline reproduced the exact CI failure in 1 of 5 runs.
  • Retirement, failed admission, deployment drain and Runtime manager tests passed 10 consecutive runs; the same selection passed 3 runs with the race detector.
  • The complete pgunit lease suite passed, including the production cancellation and transaction deadline tests.
  • git diff --check passed. A fresh independent blind reviewer found no issues and independently passed the target test 20 times with the race detector against PostgreSQL.

@SaladDay
SaladDay marked this pull request as ready for review September 30, 2026 17:07
@SaladDay
SaladDay merged commit 417bc36 into main Sep 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant