fix(tests): drain blocker completions in the async-delegation capacity test - #64369
Closed
Soju06 wants to merge 1 commit into
Closed
fix(tests): drain blocker completions in the async-delegation capacity test#64369Soju06 wants to merge 1 commit into
Soju06 wants to merge 1 commit into
Conversation
Contributor
Author
|
Noting #64431 removed the flaky test outright — this PR is the alternative that keeps the coverage: the flake was the capacity test leaking its blockers' late completion events into the next test's drain, not a defect in the crashed-runner test itself (0/15 failures with the drain vs 6/15 on the old main). Happy to rebase this to restore the removed test alongside the drain fix if you'd rather keep the assertion; equally fine closing this if the deletion is the intended end state. |
test_dispatch_rejected_at_capacity releases its two blocker workers with ev.set() and returns; their completion events enqueue asynchronously after the next test's start-of-test drain has already run. test_crashed_runner_produces_error_completion then drains a leaked 'completed' event instead of its own crash's 'error' event — reproduced 6/15 runs on main, 0/15 with the drain. Consume both completions before the test returns.
Soju06
force-pushed
the
upstream-pr/fix-async-delegation-flake
branch
from
July 14, 2026 14:43
0bab7ed to
09f7c64
Compare
Contributor
|
Thanks for tracing the completion-queue race and documenting the alternative to #64431. This is an automated hermes-sweeper review; current
Closing as implemented on main. |
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
tests/tools/test_async_delegation.py::test_crashed_runner_produces_error_completionfails intermittently in CI (and locally) with:test_dispatch_rejected_at_capacityreleases its two blocker workers withev.set()and returns immediately. The workers'completedevents land on the sharedprocess_registry.completion_queueasynchronously — often after the next test's autouse start-of-test drain has already run on a still-empty queue. The crashed-runner test's_drain_one()then picks up a leakedcompletedevent from the previous test instead of its own crash'serrorevent.Reproduction (running just the two tests in sequence): 6/15 runs fail on main, 0/15 with this fix.
This flake currently trips
Run testsslices on unrelated PRs (e.g. it failed three different PR runs today on three different slices).Change
Test-only: the capacity test consumes both blockers' completion events (
_drain_one()× 2) before returning, so nothing leaks past the next test's drain. Assertions unchanged.Tests
🤖 Generated with Claude Code