Repository navigation
Respect maintenance recovery budgets in tests - #1530
Merged
Merged
Conversation
Maintenance recovery uses the generic ten-second CI wait even though resignation attempts and backoff can take about thirteen seconds, and periodic insertion permits a thirty-second transaction. Slow database operations make the test abort a valid recovery and cancel its commit during cleanup. Give leadership recovery thirty seconds and allow periodic insertion its transaction timeout plus the normal event margin. Preserve assertions for a fresh leadership term, completed work, and exactly four startup attempts. Exercise exhausted resignation attempts and a slow periodic commit with controlled driver faults. Capture Postgres activity and blocking PIDs before shutdown when recovery fails so database delays remain observable.
brandur
approved these changes
Oct 24, 2026
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 maintenance recovery checks in this CI failure use the generic ten-second wait even though resignation attempts and backoff can take about thirteen seconds, followed by lease expiry if resignation fails. The periodic job also has a thirty-second insertion transaction timeout. The shorter waits can abort valid recovery and turn cleanup into a misleading commit cancellation error.
Give leadership recovery thirty seconds and allow periodic insertion its transaction timeout plus the normal event margin. Preserve the fresh-term, completed-job, and exact startup-count assertions. Add controlled resignation timeouts and an eleven-second periodic commit that reproduce both failures with the old waits and recover with the new ones. Capture Postgres activity, wait events, and blocking PIDs before client shutdown on failure.
The original run does not record database wait events, so this fixes the demonstrated deadline mismatches without attributing the initial database latency to a particular lock or storage event.