Skip to content

Bound acceptance tests by the test's CancelAfter budget instead of the fixed 90 s Done limit - #5870

Closed
ramonsmits wants to merge 1 commit into
masterfrom
ramon/acceptance-test-timeout
Closed

ramonsmits wants to merge 1 commit into
masterfrom
ramon/acceptance-test-timeout

Conversation

@ramonsmits

@ramonsmits ramonsmits commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

NServiceBus.AcceptanceTesting caps Done at 90 seconds unless Run receives a cancellable token. The journey tests added in #5810 (When_deleted_messages_are_restored, When_a_failing_custom_check_is_dismissed) regularly exceed that on Windows runners and account for most Windows-Raven failures across all branches over the past week.

NServiceBusAcceptanceTest now carries [CancelAfter(180_000)], which NUnit applies to every derived fixture, and Define wraps the scenario so that Run() without a token uses TestContext.CurrentContext.CancellationToken. A test that already declares [CancelAfter] keeps its own value. The runsettings DefaultTimeout route does not work here: NUnit3TestAdapter only forwards it under #if NET462.

Verified locally with a throwaway test: a method-level [CancelAfter(5_000)] on a never-completing scenario fails after 5.9 s with The scenario did not complete within the test's CancelAfter budget of 5000 ms., and existing Primary, Audit and Monitoring tests pass unchanged.

Pairs with #5872: without it a timed-out test reports the TaskCanceledException from the aborted host shutdown instead of the timeout.

…the 90 s Done limit

NServiceBus.AcceptanceTesting caps Done at a fixed 90 seconds unless Run is
handed a cancellable token. The multi-step journey tests regularly exceed
that on Windows runners, where three embedded RavenDB servers share four
cores, and fail with a timeout while still making progress.

NServiceBusAcceptanceTest now carries [CancelAfter(180_000)], which NUnit
applies to every derived fixture through the execution context, and Define
wraps the scenario so that Run() without a token uses the test's own. A test
that already declares [CancelAfter] keeps its value, and the failure message
names the budget that ran out instead of the framework's infinite limit.
@danielmarbach

danielmarbach commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Should we try to improve this in Core instead? I'm worried because it adds extra API surface the Core acceptance test infrastructure might need to have anyway and then things need to be kept in sync

@danielmarbach

danielmarbach commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

@ramonsmits

Copy link
Copy Markdown
Member Author

@ramonsmits ramonsmits closed this Sep 10, 2026
@danielmarbach
danielmarbach deleted the ramon/acceptance-test-timeout branch September 10, 2026 10:29
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.

4 participants