Wait for the fast rollout before timing gather's partial return - #193
Merged
Merged
Conversation
test_gather_timeout_returns_partial raced a trivial forked child against a 2 s gather timeout. Under pytest-cov every forked child starts its own coverage tracer, and in a CI shard with thousands of modules imported on a busy node that start-up alone can pass 2 s, so the fast rollout was still pending and the test failed. Measured on a quicktest node with 5,600 modules imported: launch to result took 0.06 s without coverage, 0.3 s with it, and 1.0 to 2.9 s with coverage under CPU contention. The test now waits for the fast child first, then checks that a short gather timeout returns it as done and the slow child as pending without blocking.
2 tasks done
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.
Summary
tests/agent_sdk/test_async_rollouts.py::test_gather_timeout_returns_partialfailed in a CI-container replay of shard 7:gather([fast, slow], timeout=2)returned with the trivialfastrollout still pending.The test raced a forked child's start-up against a 2 s timeout.
Under pytest-cov every forked child starts its own coverage tracer, and in a shard with thousands of modules imported on a busy node that start-up alone can pass 2 s.
Measured on a quicktest node with 5,600 modules imported, launch to result took:
The test now waits for the fast child on its own first, then checks that a short
gathertimeout returns it as done and the slow child as pending without blocking.The registry is unchanged.
Independent of the #189-#192 and #194 stack; it touches only this test file.
Test plan
test_async_rollouts.pypasses with the fix (all 9 tests, including the overlap test next to it).🤖 Generated with Claude Code