Repository navigation
test: scale-the-timeout test no longer races interpreter startup - #112
Merged
Merged
Conversation
test_the_timeout_is_scaled_for_a_slow_runner started a python that slept 1.2 s under a 0.5 s timeout scaled to 1.5 s, so it passed only if the interpreter started in under 0.3 s; on a loaded CI runner it did not (linux-64 py3.12 on #109). Hand the wrapper a stand-in for subprocess.run instead and look at the timeout it passes on. The wrapper is now retrying_run(run), exposed through the launch_policy fixture. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
test_the_timeout_is_scaled_for_a_slow_runnerran a python that slept 1.2 s under a 0.5 s timeout that the harness scales to 1.5 s, so it passed only if the interpreter started in under 0.3 s. On a loaded CI runner it did not: it failed onlinux-64 / py3.12of #109 (TimeoutExpired ... timed out after 1.5 seconds), a PR that touches nothing near it.Fix: the test now hands the wrapper a stand-in for
subprocess.runand checks the timeout it passes on (1.5 for 0.5 at scale 3, and none invented when none is given). To make that possible the wrapper isretrying_run(run)intest/conftest.py, exposed through the existinglaunch_policyfixture; the autouse fixture just installs it. Behavior of the wrapper is unchanged.Checked: all 11 tests in the file pass; with the scaling line removed from the wrapper the test fails, so it still guards what it was written for. I looked at the other tests in that file and none races wall-clock time (the relaunch delay is set to 0).
🤖 Generated with Claude Code