Fix the Windows CI wedge: skip the per-event fsync barrier in the sessions load tests#598
Merged
Merged
Conversation
test_no_turn_is_ever_lost and test_listing_stays_correct_at_volume fire thousands of SessionStore writes in a tight loop, each ending in os.fsync. On Windows os.fsync is a real FlushFileBuffers disk barrier (~4ms/event measured locally vs ~0.05ms on macOS, a 77x gap), so ~2200 back-to-back barriers on a throttled CI disk ran for tens of minutes and tripped the timeout/watchdog. macOS/Linux never saw it because their os.fsync is not a real barrier. Neutralize os.fsync in this suite's fixture only. None of the invariants it asserts depend on fsync -- append-only, nothing-lost, torn-tail, and concurrent-writer safety all rest on O_APPEND, one write per event, flush, and the FileLock. Production is untouched: real usage appends one event per user turn, seconds apart, where the barrier is cheap and buys genuine crash durability. Keeping the 2000-event volume still stresses the append/lock/read paths; only the unrealistic barrier density is removed.
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.
Problem
testjob wedged (27 min to the 120 min timeout) ontest_no_turn_is_ever_lostandtest_listing_stays_correct_at_volume.SessionStorewrites in a tight loop, each ending inos.fsync. On Windowsos.fsyncis a realFlushFileBuffersdisk barrier (~4ms/event measured locally vs ~0.05ms on macOS, a 77x gap); ~2200 back-to-back barriers on a throttled CI disk ran for tens of minutes. macOS/Linux never saw it (theiros.fsyncisn't a real barrier).Solution
os.fsyncin this suite's fixture only (monkeypatch, reverts per test). No production change.O_APPEND+ one write per event + flush + theFileLock. All 8 tests pass fsync-free.