Repository navigation
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
Closed
ramonsmits wants to merge 1 commit into
ramonsmits wants to merge 1 commit into
Conversation
…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.
mauroservienti
approved these changes
Sep 9, 2026
rbev
approved these changes
Sep 10, 2026
rbev
approved these changes
Sep 10, 2026
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 |
Contributor
Member
Author
|
Decided to move this to core: |
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.
NServiceBus.AcceptanceTesting caps
Doneat 90 seconds unlessRunreceives 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.NServiceBusAcceptanceTestnow carries[CancelAfter(180_000)], which NUnit applies to every derived fixture, andDefinewraps the scenario so thatRun()without a token usesTestContext.CurrentContext.CancellationToken. A test that already declares[CancelAfter]keeps its own value. The runsettingsDefaultTimeoutroute 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 withThe 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
TaskCanceledExceptionfrom the aborted host shutdown instead of the timeout.