-
Notifications
You must be signed in to change notification settings - Fork 5k
[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
[release/9.0-staging] Backport "Dispose Xunit ToolCommand" #116685
Conversation
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.
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. |
Co-authored-by: Marek Fišera <[email protected]>
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.
approved. we can treat this as tell mode
Tagging subscribers to 'arch-wasm': @lewing |
22cf0cd
into
dotnet:release/9.0-staging
Backport of #108319, #108387 to release/9.0-staging
/cc @lewing
Customer Impact
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
Testing
Manual testing.
Risk
Low. This is a change to tests only.