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.
Fix #6198: surface global test init/cleanup timeout/cancellation failures #8288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Fix #6198: surface global test init/cleanup timeout/cancellation failures #8288
Changes from all commits
6fab19a58989255166ae73bd965aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
globalTestInitExceptionhasOutcome = Timeout(the common case for this bug fix), throwing it into the inner catch causesresult.Outcometo be set toFailedinstead ofTimeout. The catch block's logic is:This is inconsistent with local
TestInitializetimeouts, whereRunTestInitializeMethodAsynchas a special path that preservestfe.Outcome:Consider adopting the same pattern here instead of throwing. For example, after the
foreachloop exit you could check ifglobalTestInitExceptionis not null and return early via asetTestContextSucessful = false-style guard, or handle it directly analogously toRunTestInitializeMethodAsync.The current tests only verify message text (
AssertOutputContains("...timed out after 1000ms")), not theOutcomevalue, so this regression isn't caught by the test suite.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3bd965a. I updated
ExecuteInternalAsyncto preserveTestFailedException.Outcome(includingTimeout) instead of normalizing toFailed, and added focused unit coverage (TestMethodInfoInvokeShouldPreserveTimeoutOutcomeForGlobalTestInitialize).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
globalTestCleanupExceptionis aTestFailedExceptionwithOutcome = Timeout, the re-wrapping code:...causes the final test outcome to be
Failedrather thanTimeout. Separately,GetFormattedExceptionMessage()on theTestFailedExceptionproduces a message that already contains the method name and "timed out after Xms", so the finalUTA_CleanupMethodThrowsformat wraps it as:This is a minor redundancy in the message (method name appears twice, "timed out" framing is inside "threw exception").
This same issue affects local
TestCleanuptimeouts too (pre-existing), so this PR doesn't make it worse — but it's worth tracking since adding ais TestFailedException tfe → result.Outcome = tfe.Outcomefast-path toRunTestCleanupMethodAsync(similar toRunTestInitializeMethodAsync) would fix both.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3bd965a.
RunTestCleanupMethodAsyncnow preservesTestFailedException.Outcomefor cleanup paths and tracks the currently executing global cleanup method so thrown global cleanup exceptions are attributed to the correct method. I also added focused unit tests for global cleanup timeout outcome and thrown-method attribution.Uh oh!
There was an error while loading. Please reload this page.