Repository navigation
[candidate/11 sr3] Register HangDump in the TestUtils unit-test host - #41224
Merged
kubaflo merged 1 commit intoDec 4, 2026
Merged
Conversation
<!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `7eaf806f7513810dcbd94ca03a1500a5ee4302f4` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 9.5/10 | ↑ [PR CI 1706633](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1706633) completed with all 33 jobs green, including all four TestUtils runner and TRX validation pairs.<br>↑ The local suite also runs without the opt-in; device-host invocation, test selection and pipeline configuration are unchanged. | | Diagnosis confidence | 10/10 | ↑ The HangDump package was already restored, but the custom entry point did not register its provider; removing only the registration reproduces exit 5, and restoring it produces a valid TRX. | | Evidence fit | 10/10 | ↑ The local baseline matched all four Windows/macOS CI failures, and the same four configurations now execute tests and validate their TRX with the original HangDump options. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change <!-- Enter description of the fix in this section --> `TestUtils.UnitTests` exits before running any tests on Windows and macOS Debug/Release in [net11 maui-pr 1706373](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1706373), with an invalid-arguments handshake failure (exit 5). #41038 passes `--hangdump` and restores the HangDump package, but this project supplies its own MTP entry point, so referencing the package doesn't register its provider. Register HangDump in the custom host only when `TestUtils.UnitTests` builds with `EnableUnitTestHangDump=true`. Leave the diagnostic flags, ordinary test runs, and device test hosts unchanged. **Validation:** Ran on macOS arm64 with the repository .NET 11 SDK: ```sh ./.dotnet/dotnet test --project src/TestUtils/tests/TestUtils.UnitTests/TestUtils.UnitTests.csproj --configuration Debug --report-trx --hangdump --hangdump-timeout 10m --hangdump-type Mini -p:_SkipUpdateBuildNumber=true -p:EnableUnitTestHangDump=true --results-directory <results-dir> ``` | Run | Result | | --- | --- | | Unchanged net11 with the CI flags | Exit 5, handshake failure, no tests ran | | Unchanged net11 without the three HangDump flags, package still enabled | 61 passed; 1 Windows-only test skipped | | Fixed Debug with CI flags | 61 passed; 1 skipped; MTP TRX produced | | Only the registration removed | Exit 5, handshake failure, no tests ran | | Registration restored, Debug and Release with CI flags | Each: 61 passed; 1 skipped; MTP TRX produced | | Fixed Debug without the HangDump flags or opt-in | 61 passed; 1 skipped | [maui-pr 1706633](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1706633) completed successfully, with 33 succeeded timeline jobs. All four targeted runner/validator pairs succeeded. Raw log pairs: macOS Debug 259/260 and Release 240/241 (61 passed, 1 skipped each); Windows Debug 333/334 and Release 367/368 (62 passed each). ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> No separate issue. Fixes the `TestUtils.UnitTests` handshake regression in #41038. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, the agent opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 0390753)
Contributor
Author
|
@dalexsoto stamp |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
946bedc34f141ef215926b962ba240a7bf31d75e↑ Local sr3 run with CI's exact flags produces a TRX (61 passed, 1 skipped, 0 failed).
↓ sr3 maui-pr CI on this head is still pending.
--hangdump ... -p:EnableUnitTestHangDump=truethen "exit code: 5. The command-line arguments are invalid") on Windows and macOS.Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Cherry-pick (
-x) of net11 #41148 ontocandidate/11.0.1xx-sr3.TestUtils.UnitTestsexits before running any tests in sr3 maui-pr 1707534 on Windows and macOS. MTP reports exit 5, "command-line arguments are invalid".The cause: #41038 passes
--hangdumpand restores the HangDump package, but this project supplies its own MTP entry point (HeadlessTestRunner). That entry point never registered the HangDump provider, so MTP rejected the flag. The fix registersAddHangDumpProvider()whenEnableUnitTestHangDump=true, using theENABLE_UNIT_TEST_HANG_DUMPdefine.Validation
Ran locally on sr3
2253c0bf, with the same flags CI uses:dotnet test --project src/TestUtils/tests/TestUtils.UnitTests/TestUtils.UnitTests.csproj --configuration Debug --report-trx --hangdump --hangdump-timeout 10m --hangdump-type Mini --results-directory <dir> -p:_SkipUpdateBuildNumber=true -p:EnableUnitTestHangDump=trueIssues Fixed
N/A. This is a candidate CI fix, a port of #41148.