Skip to content

Stop ServiceControl test hosts with their own budget instead of the test's cancelled token - #5872

Merged
ramonsmits merged 1 commit into
masterfrom
ramon/acceptance-test-graceful-stop
Sep 9, 2026
Merged

ramonsmits merged 1 commit into
masterfrom
ramon/acceptance-test-graceful-stop

Conversation

@ramonsmits

Copy link
Copy Markdown
Member

The scenario runner's finally stops every component with the test's cancellation token. When a test has timed out that token has already fired, so host.StopAsync aborts inside ErrorIngestion.EnsureStopped and its TaskCanceledException replaces 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.Stop implementations 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-completing Done now fails with the framework's TimeoutException and teardown completes in 0.14 s, where before it failed with the TaskCanceledException from EnsureStopped.

… 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.
@ramonsmits
ramonsmits merged commit a23b86a into master Sep 9, 2026
69 of 70 checks passed
@ramonsmits
ramonsmits deleted the ramon/acceptance-test-graceful-stop branch September 9, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants