Repository navigation
MTP: ensure post-session display runs after cancellation - #7410
Merged
Merged
Conversation
Youssef Fahmy (Youssef1313)
approved these changes
Feb 14, 2026
Youssef Fahmy (Youssef1313)
left a comment
Member
There was a problem hiding this comment.
LGTM 🎉
I only reviewed the product change. Please ensure that the added test would have been failing on current main.
Member
Author
|
Youssef Fahmy (@Youssef1313) the test fails with I don't know if we want something more strict |
Member
|
That's good enough, I think. At least for what we have today. |
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.
Summary
Fixes an inconsistency in cancellation flow for MTP test sessions.
CommonHost.ExecuteRequestAsync intentionally calls post-session display outside the cancellation catch, but DisplayAfterSessionEndRunAsync was still receiving the canceled session token.
This change passes CancellationToken.None to ensure final output/session-finishing notifications are not skipped when cancellation is requested.
Changes
Updated CommonTestHost.cs:195 to call post-session display with a non-cancelable token.
Added regression test CommonHostTests.cs verifying canceled sessions still invoke post-session display with a non-cancelable token.
Validation
Ran: dotnet test Microsoft.Testing.Platform.UnitTests.csproj --filter "FullyQualifiedName~CommonHostTests.ExecuteRequestAsync_WhenSessionIsCancelled_UsesCancellationTokenNoneForDisplayAfterSessionEndRun"
Result: pass.
Issue
Closes #6099