Skip to content

Fix result assignment after action execution#126766

Merged
AaronRobinsonMSFT merged 1 commit intomainfrom
AaronRobinsonMSFT-patch-1
Apr 11, 2026
Merged

Fix result assignment after action execution#126766
AaronRobinsonMSFT merged 1 commit intomainfrom
AaronRobinsonMSFT-patch-1

Conversation

@AaronRobinsonMSFT
Copy link
Copy Markdown
Member

Ensure result is set to TestPassed only after action execution.

Ensure result is set to TestPassed only after action execution.
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 11.0.0 milestone Apr 10, 2026
@AaronRobinsonMSFT AaronRobinsonMSFT added the test-bug Problem in test source code (most likely) label Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 21:29
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the STA-thread test harness so the exit code is only set to TestPassed after the provided action completes successfully (and is not incorrectly overwritten after a failure).

Changes:

  • Move result = TestPassed; into the try block after action() executes.
  • Ensure exceptions (including assertion failures) keep result as TestFailed.
Show a summary per file
File Description
src/tests/Interop/COM/NETClients/Lifetime/Program.cs Corrects RunOnSTAThread result assignment so failures aren’t overwritten as passes.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@AaronRobinsonMSFT AaronRobinsonMSFT enabled auto-merge (squash) April 10, 2026 21:46
@AaronRobinsonMSFT AaronRobinsonMSFT merged commit a931a07 into main Apr 11, 2026
108 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the AaronRobinsonMSFT-patch-1 branch April 11, 2026 01:57
@github-project-automation github-project-automation Bot moved this to Done in AppModel Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Interop-coreclr test-bug Problem in test source code (most likely)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants