Repository navigation
Move the test suite to Microsoft.Testing.Platform for xunit.v3 4.0.0 (#434) - #442
Conversation
|
Reviewed. This is a self-contained test-infra/CI change (xunit.v3 4.0.0 + Microsoft.Testing.Platform migration) — no application code, execution-plan XML handling, T-SQL generation, or PlanViewer.Ssms/PlanViewer.Web files touched, so most of the usual correctness/security/versioning checks don't apply here. Went through the mechanics specifically:
Description is unusually candid about what this does not fix (the GC-suspension livelock, deferred to #441) — appreciate that being called out rather than implied. No findings to flag. |
…434) Dependabot #434 fails to build, and not because of anything it did wrong: Microsoft.Testing.Platform.MSBuild.targets(320,5): error : Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later. xunit.v3 4.0.0 drops VSTest on the .NET 10 SDK. There is no version of this bump that keeps the old runner, so it is migrate or stay on 3.2.2. #433 is the same family and passes only because bumping the VSTest adapter alone changes nothing. The opt-in is repo-level, not per-project, which the target names outright (_SupportsGlobalJsonTestRunner): global.json now selects the runner. Setting TestingPlatformDotnetTestSupport in the csproj alone does not do it, and I tried that first. xunit.runner.visualstudio is dropped because it IS the VSTest adapter and has no role here any more. That moots #433. The watchdog from 5f84116 needed porting, and this is the part worth reading. Both of its layers were VSTest-only: RunSettingsFilePath/TestSessionTimeout for bare local runs, and the blame-hang options in the three workflows. The local layer is now TestingPlatformCommandLineArguments carrying a 15m session timeout, same value and same no-flags-to-remember property; the workflows pass the hangdump options, which produce the same name-the-wedged-test artifact. I verified the local layer the way the original was verified, because a silently ignored property looks exactly like a working one: set it to 1ms temporarily and a bare `dotnet test` cancelled with 0 tests succeeded, then restored it. What the port does NOT recover, stated plainly because it would be easy to leave implied: neither MTP mechanism stops the GC-suspension livelock the original watchdog was written for. Measured against a genuinely wedged host on macOS ARM64, not assumed - it ran 2m55s at 107% CPU against a 90s hangdump timeout, and 8 minutes against a 60s session timeout, ignoring both. The reason is the same one 5f84116 gives for xUnit timeouts: the diagnostics the platform needs are served by the execution engine that is suspended. MTP does put the timeout in a separate controller process, which was the property that mattered, and it still cannot win. An ordinary hang, where the runtime is responsive, is killed fine. So this is not a regression against VSTest so much as both runners being equally powerless there, and I want to be careful not to claim more: I did not prove the OLD TestSessionTimeout could kill a livelocked host either. It was verified at 1ms on a healthy run, never against a real wedge. Filed separately. Tested: 279 passed, 0 failed, 2 skipped under the new runner (the whole suite except the Mcp/Repl classes, which wedge on macOS for reasons that predate this and are the subject of that separate issue). The CI flag form was run verbatim to confirm the options parse. dotnet build clean; the 9 warnings are the pre-existing MCP9005 obsolete-API uses in McpSmokeTests.cs. Two XML-comment '--' errors on the way in, exactly as 5f84116 warned. Noted in the comment so the next person does not rediscover it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
aa1e792 to
3780c4a
Compare
|
Reviewed. This PR is entirely CI/test-infrastructure (VSTest → Microsoft.Testing.Platform migration for xunit.v3 4.0.0) — none of it touches execution-plan XML parsing, generated T-SQL, or the Static read of the diff:
One caveat I can't independently close out: this sandbox has no network/dotnet-execution access, so I could not run No correctness, security, or convention issues found. |
Minor rather than patch. 1.19.x would understate it: #439 adds a "source" field to every warning in the JSON and MCP output and a new badge in the app and CLI, and #437 changes what an existing analysis rule concludes about a plan. Both are things a consumer can notice, and one of them is output-shape. What ships: - #437 Rule 12 no longer calls a conversion non-SARGable when it converts the parameter rather than the column. Plans carrying a parameter-side conversion on a scan lose that warning and report the scan's residual predicate instead. Verified against all 38 committed plans: no other plan's verdict moves. - #439 SQL Server's own warnings are now told apart from ours, tagged [SQL Server] in the app and CLI and carried as "source" in JSON/MCP. Additive, but it changes the bytes of analyze --compact. - #431 Robot Advice no longer takes the app down on a deep plan. - #438 querystore gets the same depth ceiling analyze got; it had been failing quietly on deep plans, one ERROR row per plan. - #443 the macOS handle resolver no longer corrupts memory on Apple silicon. - #425 Entra MFA works again (WAM parent window handle). Not user-facing but worth knowing for anyone building from this tag: the suite runs on Microsoft.Testing.Platform now (#442), and `dotnet test` finishes on macOS for the first time (#443) - 307 tests, 305 passing, 13 seconds. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fixes the build failure on Dependabot #434, and supersedes both #434 and #433.
Why #434 fails
xunit.v34.0.0 drops VSTest on the .NET 10 SDK. There is no version of that bump that keeps the old runner — it is migrate or stay on 3.2.2. #433 is the same family and passes only because bumping the VSTest adapter on its own changes nothing.What moved
_SupportsGlobalJsonTestRunner), soglobal.jsonnow selects the runner.TestingPlatformDotnetTestSupportin the csproj alone does not do it — that was my first attempt and it reproduced the same error.xunit.runner.visualstudiois dropped, because it is the VSTest adapter and has no role any more. That moots deps: Bump xunit.runner.visualstudio from 3.1.5 to 4.0.0 #433.--filterstill works in the form the workflows and local runs already use.The watchdog port — the part worth reviewing
Both layers of
5f84116were VSTest-only.RunSettingsFilePath/TestSessionTimeoutcovered bare local runs;--blame-hangcovered the three workflows.dotnet testRunSettingsFilePath→TestSessionTimeout15mTestingPlatformCommandLineArguments→--timeout 15m--blame-hang --blame-hang-timeout 5m-- --hangdump --hangdump-timeout 5m --hangdump-type noneThe local layer is verified the way the original was, since a silently ignored property looks exactly like a working one: set to
1mstemporarily, a baredotnet testcancelled the run with 0 tests succeeded, then restored.What the port does NOT recover
Stating this plainly because it would be easy to leave implied. Neither MTP mechanism stops the GC-suspension livelock the original watchdog was written for. Measured against a genuinely wedged host on macOS ARM64:
--hangdump-timeout 90s— never fired.--timeout 60s— never fired.The reason is the one
5f84116already gives for xUnit's own timeouts: the diagnostics the platform needs are served by the execution engine that is suspended. MTP does put the timeout in a separate controller process — I confirmed the process tree, and that was the property that mattered — and it still cannot win.An ordinary hang, where the runtime is responsive, is killed fine.
I am not claiming this is a regression against VSTest. I did not prove the old
TestSessionTimeoutcould kill a livelocked host either — it was verified at 1ms on a healthy run, never against a real wedge. Both runners may be equally powerless here. Filed separately as #441.Tests
279 passed, 0 failed, 2 skipped under the new runner — the whole suite except the
Mcp/Replclasses, which wedge on macOS for reasons that predate this PR and are the subject of #441. CI runs onubuntu-latestand is unaffected. The CI flag form was run verbatim to confirm the options parse.dotnet buildclean; the 9 warnings are the pre-existingMCP9005obsolete-API uses inMcpSmokeTests.cs.Not merging this myself — it changes how tests run everywhere, including your laptop.
🤖 Generated with Claude Code