Skip to content

[release/9.0-staging] Backport "Dispose Xunit ToolCommand" #116685

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

Conversation

ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Jun 16, 2025

Backport of #108319, #108387 to release/9.0-staging

/cc @lewing

Customer Impact

  • Customer reported
  • Found internally

This is a tell mode.
Merging these changes helped reduce #105315 hit on main. We're still having problems with net9 branch. This PR should mitigate it.

Regression

  • Yes
  • No

Testing

Manual testing.

Risk

Low. This is a change to tests only.

@Copilot Copilot AI review requested due to automatic review settings June 16, 2025 08:53
@ilonatommy ilonatommy requested a review from maraf as a code owner June 16, 2025 08:53
@ilonatommy ilonatommy added the Servicing-consider Issue for next servicing release review label Jun 16, 2025
Copy link
Contributor

@Copilot 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

This PR is a backport to release/9.0-staging that improves resource management in various test commands by refactoring to use using declarations and ensuring proper disposal of command objects. Key changes include refactoring DotNetCommand, RunCommand, and ToolCommand usages to ensure disposal, and adding an isDisposed flag to ToolCommand to prevent post‑disposal events from processing.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs Refactored DotNetCommand usage to a using block for proper disposal.
src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/WasmAppBuilderDebugLevelTests.cs Updated RunCommand usage with a using declaration.
src/mono/wasm/Wasm.Build.Tests/TestAppScenarios/SatelliteLoadingTests.cs Converted DotNetCommand to using block for resource management.
src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs Refactored multiple RunCommand and DotNetCommand usages to using blocks.
src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs Updated command execution to use using blocks.
src/mono/wasm/Wasm.Build.Tests/NonWasmTemplateBuildTests.cs Refactored DotNetCommand usage to use a using block with ToolCommand.
src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs Added an isDisposed flag and updated event handlers to check disposal state.
src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs Converted DotNetCommand usage to a using block via ToolCommand.
src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests3.cs, MiscTests2.cs, CleanTests.cs, BlazorWasmTestBase.cs Consistently applied using patterns to improve resource cleanup in test scenarios.

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. we can treat this as tell mode

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release arch-wasm WebAssembly architecture area-VM-meta-mono and removed Servicing-consider Issue for next servicing release review labels Jun 17, 2025
@jeffschwMSFT jeffschwMSFT added this to the 9.0.7 milestone Jun 17, 2025
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@ilonatommy
Copy link
Member Author

/ba-g Build analysis is red, without failures

image

@ilonatommy ilonatommy merged commit 22cf0cd into dotnet:release/9.0-staging Jun 19, 2025
30 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants