Fix non-deterministic bgw_job_stat_history test timing #9216
+52
−50
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.
Summary
This PR was automatically generated by Claude Code to fix a failing nightly CI test.
Test Fixed
bgw_job_stat_historyWhat Changed
The bgw_job_stat_history test was failing intermittently on macOS Debug builds due to using
now()for generating test data. The test expected 8645 records but got 8641 due to timing variations between test runs. Fixed by introducing a fixed timestamp variable (NOW_TEST1 = '2025-08-15 12:00:00') and replacing allnow()calls in test data generation with this deterministic value. The expected count of 8641 is mathematically correct (90 days * 96 intervals per day + 1 for inclusive endpoints).Co-Authored-By: Claude [email protected]
Original Failure
Testing
Please review the fix and ensure it is appropriate before merging.
The CI will run the full test suite to verify the fix.
🤖 Generated with Claude Code