Repository navigation
Stop ServiceControl test hosts with their own budget instead of the test's cancelled token - #5872
Merged
Merged
Conversation
… test's cancelled token The scenario runner stops every component with the test's cancellation token, which has already fired when the test timed out. host.StopAsync then aborts inside ErrorIngestion.EnsureStopped, and that TaskCanceledException replaces the timeout as the reported failure, which is how a slow test shows up in CI as "A task was canceled" with no hint that it ran out of time. Shutdown now runs on a 30 second budget of its own.
mauroservienti
approved these changes
Sep 9, 2026
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.
The scenario runner's
finallystops every component with the test's cancellation token. When a test has timed out that token has already fired, sohost.StopAsyncaborts insideErrorIngestion.EnsureStoppedand itsTaskCanceledExceptionreplaces the timeout as the reported failure. That is what a slow acceptance test looks like in CI today: "A task was canceled" with no hint that it ran out of time, and a host that was never shut down cleanly.The three
ServiceControlComponentRunner.Stopimplementations now shut down on a 30 second budget of their own. Applies to the 23 tests that already use[CancelAfter]and to whichever of #5870 / #5871 lands.Verified locally: a
[CancelAfter(5_000)]test with a never-completingDonenow fails with the framework'sTimeoutExceptionand teardown completes in 0.14 s, where before it failed with theTaskCanceledExceptionfromEnsureStopped.