Repository navigation
test: replace sleeps in Rust tests with deterministic waits - #3146
Draft
liangmiQwQ wants to merge 3 commits into
Draft
liangmiQwQ wants to merge 3 commits into
liangmiQwQ wants to merge 3 commits into
Conversation
Split version selection out of cleanup_old_versions so tests pass explicit creation times instead of sleeping between create_dir calls, which left the order arbitrary on filesystems with coarse or missing birth times. One filesystem test still covers the directory scan with an order-independent outcome.
Wait until every check except the one holding the registry request has returned, then assert that request is still in flight, instead of sleeping 200ms and sampling the request count.
The child processes slept for 2s while the parent polled for up to 5s and then asserted they were still running. They now block on stdin until the test closes it.
This branch has not been deployed
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.
Some Rust tests rely on sleeps to order events, which makes them depend on runner speed and filesystem timestamps.
vp_setupcleanup: the tests slept betweencreate_dircalls so that creation times differ, but the order is arbitrary on filesystems with coarse or missing birth times. This PR moves the selection out ofcleanup_old_versionsinto a privateversions_to_remove, so the tests pass explicit times and assert the exact removed versions. A filesystem test still covers the directory scan with an order-independent result.implode(Windows): the child processes block on stdin until the test closes it, instead of sleeping 2 seconds while the parent polls for up to 5 seconds.No behavior changes.
🤖 Generated with Claude Code