Show currently running tests in dotnet test MTP output (#49712) - #54486
Merged
Conversation
Adds a new TestInProgressMessages IPC message type (serializer id 10) so that the test platform can notify the SDK when a test starts. The SDK already has rendering machinery for in-progress tests (TestProgressState, TestNodeResultsState, AnsiTerminalTestProgressFrame, including the '... and X more' trimming) but it was dead because the protocol carried no 'test started' event and ShowActiveTests was never enabled. Changes: * IPC layer: new TestInProgressMessages model + TLV serializer, registered with id 10. Back-compat is preserved by the TLV format (unknown field ids are skipped) and NamedPipeServer skipUnknownMessages, so old SDKs paired with new MTPs continue to work and vice-versa. * Handler: TestApplicationHandler.OnTestInProgressReceived forwards each event to TerminalTestReporter.TestInProgress(assembly, tfm, arch, executionId, instanceId, uid, displayName). * State: TestNodeResultsState now keys running tests by (instanceId, uid) and tracks a completed set, so a stale in-progress notification arriving after the matching test result cannot resurrect a 'running' entry. Retries (new instanceId) are still surfaced correctly. * Default-on: ShowActiveTests is enabled when AnsiMode == AnsiIfPossible and progress is not suppressed, so it stays off in CI, --no-ansi, --no-progress and LLM environments. * Tests: round-trip + serializer id assertion for the new serializer, plus stale-add suppression / retry handling for TestNodeResultsState. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables live display of currently running tests in dotnet test for Microsoft.Testing.Platform by adding an IPC message for in-progress tests and wiring it into the existing terminal progress renderer.
Changes:
- Adds
TestInProgressMessagesIPC model, serializer, field IDs, and serializer registration. - Dispatches in-progress test events through
TestApplicationHandlerintoTerminalTestReporter. - Updates active-test state tracking to key by
(instanceId, uid)and adds tests for serializer and state behavior.
Show a summary per file
| File | Description |
|---|---|
src/Cli/dotnet/Commands/Test/MTP/IPC/Models/TestInProgressMessages.cs |
Adds IPC records for running-test notifications. |
src/Cli/dotnet/Commands/Test/MTP/IPC/ObjectFieldIds.cs |
Reserves field and serializer IDs for in-progress test messages. |
src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/RegisterSerializers.cs |
Registers the new serializer. |
src/Cli/dotnet/Commands/Test/MTP/IPC/Serializers/TestInProgressMessagesSerializer.cs |
Implements TLV serialization for in-progress test messages. |
src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs |
Routes the new message type to the handler. |
src/Cli/dotnet/Commands/Test/MTP/TestApplicationHandler.cs |
Validates and forwards running-test notifications to the reporter. |
src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalTestReporter.cs |
Adds instance-aware active-test updates and removal. |
src/Cli/dotnet/Commands/Test/MTP/Terminal/TestNodeResultsState.cs |
Tracks running tests by instance and suppresses stale completed entries. |
src/Cli/dotnet/Commands/Test/MTP/MicrosoftTestingPlatformTestCommand.cs |
Enables active-test display for ANSI progress mode. |
test/dotnet.Tests/CommandTests/Test/TestInProgressMessagesSerializerTests.cs |
Adds serializer round-trip and ID coverage. |
test/dotnet.Tests/CommandTests/Test/TestNodeResultsStateTests.cs |
Adds coverage for stale-add suppression and retry keying. |
Copilot's findings
- Files reviewed: 11/11 changed files
- Comments generated: 1
…pability The ShowActiveTests option is set based on the requested AnsiMode, but TerminalTestReporter may decide at runtime to disable progress (e.g. when stdout is redirected, console is non-TTY, or ANSI codes aren't accepted). In that case the incoming TestInProgress events would still allocate and update TestNodeResultsState even though nothing can ever be rendered. Compute an effective _showActiveTests in the ctor as _options.ShowActiveTests && showProgress and use it to gate both the AddRunningTestNode and RemoveRunningTestNode paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evangelink
enabled auto-merge
May 29, 2026 07:20
This was referenced May 29, 2026
JanKrivanek
approved these changes
Jun 1, 2026
baronfel
added a commit
to dotnet/core
that referenced
this pull request
Jul 10, 2026
Document the in-flight test progress panel (dotnet/sdk#54486) and fix pre-existing trailing-space lint errors in the NativeAOT section. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
baronfel
added a commit
to dotnet/core
that referenced
this pull request
Jul 10, 2026
* [release-notes] .NET SDK in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Clarify NativeAOT CLI updates in preview6/sdk.md Updated the NativeAOT CLI section to clarify the unification of managed and NativeAOT parsers, and removed filtered content related to internal changes. * Add live running-tests display to dotnet test notes Document the in-flight test progress panel (dotnet/sdk#54486) and fix pre-existing trailing-space lint errors in the NativeAOT section. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chet Husk <baronfel@users.noreply.github.com> Co-authored-by: Chet Husk <chusk3@gmail.com>
rbhanda
added a commit
to dotnet/core
that referenced
this pull request
Jul 14, 2026
* [release-notes] .NET 11 Preview 6 base metadata changes.json, features.json, build-metadata.json, and README for the .NET 11 Preview 6 milestone (VMR base v11.0.0-preview.5.26302.115 -> head release/11.0.1xx-preview6). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [release-notes] C# in .NET 11 Preview 6 (#10460) * [release-notes] C# in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update release-notes/11.0/preview/preview6/csharp.md --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Bill Wagner <wiwagn@microsoft.com> * [release-notes] MSBuild in .NET 11 Preview 6 (#10463) * [release-notes] MSBuild in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add bug-fix note for architecture-agnostic Runtime=NET task host handshake (dotnet/msbuild#13890) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Remove HTML comments from Preview 6 MSBuild release notes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chet Husk <chusk3@gmail.com> * [release-notes] NuGet in .NET 11 Preview 6 (#10464) * [release-notes] NuGet in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix STJ feature-flag env var value and remove VS reference Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chet Husk <chusk3@gmail.com> * [release-notes] .NET SDK in .NET 11 Preview 6 (#10459) * [release-notes] .NET SDK in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Clarify NativeAOT CLI updates in preview6/sdk.md Updated the NativeAOT CLI section to clarify the unification of managed and NativeAOT parsers, and removed filtered content related to internal changes. * Add live running-tests display to dotnet test notes Document the in-flight test progress panel (dotnet/sdk#54486) and fix pre-existing trailing-space lint errors in the NativeAOT section. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Chet Husk <baronfel@users.noreply.github.com> Co-authored-by: Chet Husk <chusk3@gmail.com> * [release-notes] Windows Forms in .NET 11 Preview 6 (#10465) * [release-notes] Windows Forms in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Revise Windows Forms release notes for Preview 6 Updated release notes for .NET 11 Preview 6 to include bug fixes and improvements for various Windows Forms components. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Klaus Löffelmann <9663150+KlausLoeffelmann@users.noreply.github.com> * [release-notes] .NET MAUI in .NET 11 Preview 6 (#10467) * [release-notes] .NET MAUI in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Draft .NET MAUI and friends notes for .NET 11 Preview 6 Combined highlights for .NET MAUI, .NET for Android, and .NET for iOS, Mac Catalyst, macOS, and tvOS: CollectionView2 on Windows, handler-based Shell on Android, Compatibility package removal, AOT-safe HybridWebView, Geolocation minimum-distance filter, a reliability wave, the AndroidMessageHandler HTTP-contract work, and the Apple platform toolchain and NSUrlSessionHandler updates. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Add Preview 6 items from MAUI maintainer review Incorporates jfversluis review feedback on #10467: - Android MediaPicker result recovery APIs (dotnet/maui#35455) - HybridWebView Android message-source filtering (dotnet/maui#35717) - XAML C# expression source generator CS1061 fix (dotnet/maui#35922) - Testable permissions via IPermissions/Permissions.Current (dotnet/maui#35987) - XA0149 warning for legacy __AndroidEnvironment__ resources (dotnet/android#11700) - Skip library proguard.txt with disallowed R8 global options (dotnet/android#11709) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: David Ortinau <david.ortinau@microsoft.com> * [release-notes] EF Core in .NET 11 Preview 6 (#10462) Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> * [release-notes] F# in .NET 11 Preview 6 (#10461) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [release-notes] Containers in .NET 11 Preview 6 (#10468) * [release-notes] Containers in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update release notes --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Logan Bussell <loganbussell@microsoft.com> * [release-notes] .NET Libraries in .NET 11 Preview 6 (#10457) * [release-notes] .NET Libraries in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix async DataAnnotations sample after testing on the Preview 6 SDK AsyncValidationAttribute is overridden via the protected IsValidAsync (and IsValid) members, not GetValidationResultAsync (which is the public method the framework calls and is not virtual). Verified the corrected sample compiles and runs against the Preview 6 build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Verify Preview 6 library samples and fix inaccuracies - Stream adapters: read from the read-only stream via StreamContent/PostAsync instead of copying HttpContent into it - Cross-lane vectors: replace nonexistent Concat with ConcatLowerLower/LowerUpper/UpperLower/UpperUpper and drop preexisting Shuffle/ShuffleNative - Async validation: swap the unique-username example for a VAT registry lookup, layer StringLength and RegularExpression sync rules with the async rule, and add a server-side validation note Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com> * [release-notes] ASP.NET Core in .NET 11 Preview 6 (#10456) * [release-notes] WPF in .NET 11 Preview 6 (#10466) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Throw InvalidOperationException for sync validation of async validator Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Apply late review suggestions from #10456 to the ASP.NET Core notes - OpenAPI unions: correct the third-party generator claim (ApiExplorer does not detect unions via JsonTypeInfoKind.Union; Swashbuckle/NSwag don't yet recognize unions). Per @DeagleGross review on #10456. - Blazor Virtualize: note that a user scroll during ScrollToIndexAsync wins. Per @ilonatommy review on #10456. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add P6 Blazor items to align with docs (dotnet/AspNetCore.Docs#37322) - CSRF: note that Blazor Web App templates no longer call app.UseAntiforgery(). - Bug fixes/Blazor: Virtualize is now CSP-compliant (#66680); session cookie is issued before streaming SSR for [SupplyParameterFromSession]/TempData (#66832). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Document 'Configure Blazor client behavior from the server' as a P6 feature WithBrowserOptions flows client-side Blazor.start configuration from the server in C# (log level, Server reconnection, SSR DOM preservation, WASM environment), serialized to the client across Server/WebAssembly/Auto render modes. Introduced in Preview 4 (server-to-browser config via DOM comment) and reshaped in Preview 6 (dotnet/aspnetcore#67337, proposal #66393). Includes the reshape/rename migration for earlier adopters. Sample build-verified on 11.0.100-preview.6.26359.118. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Correct Virtualize CSP note: data-blazor-virtualize-reserved-height Reviewing dotnet/AspNetCore.Docs#37322 surfaced that the attribute is data-blazor-virtualize-reserved-height (only the server-computed spacer height), not the generic data-blazor-style. Verified in the P6 source (Virtualize.cs / Virtualize.ts). @ilonatommy corrected the same wording on the docs PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [release-notes] .NET Runtime in .NET 11 Preview 6 (#10458) * [release-notes] .NET Runtime in .NET 11 Preview 6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Enrich Preview 6 runtime notes with additional verified features Fold verified .NET 11 Preview 6 runtime changes into runtime.md (JIT improvements, in-process crash logging, NativeAOT interface dispatch, SIMD lane APIs, and an expanded bug-fix list), and rebuild the TOC to match the current sections. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ade796bb-8052-4946-b204-a88518267e77 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Rich Lander <2608468+richlander@users.noreply.github.com> * fix markdown lint in preview6 containers note Co-authored-by: jongalloway <68539+jongalloway@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Bill Wagner <wiwagn@microsoft.com> Co-authored-by: Chet Husk <chusk3@gmail.com> Co-authored-by: Chet Husk <baronfel@users.noreply.github.com> Co-authored-by: Klaus Löffelmann <9663150+KlausLoeffelmann@users.noreply.github.com> Co-authored-by: David Ortinau <david.ortinau@microsoft.com> Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> Co-authored-by: Logan Bussell <loganbussell@microsoft.com> Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Rich Lander <2608468+richlander@users.noreply.github.com> Co-authored-by: Rahul Bhandari <rbhanda@microsoft.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jongalloway <68539+jongalloway@users.noreply.github.com>
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.
Fixes #49712.
What
Surfaces currently-running tests in the dotnet test output for projects using Microsoft.Testing.Platform (MTP). The SDK already has all of the rendering machinery for this (
TestProgressState/TestNodeResultsState/AnsiTerminalTestProgressFrame— including the... and X moretrimming), but it was dead code because:test startedevent for MTP, onlyTestResultMessages.TerminalTestReporterOptions.ShowActiveTestswas never set.This PR addresses both.
Changes
TestInProgressMessagesmodel + TLV serializer registered with id10. MirrorsDiscoveredTestMessages.TestApplication.OnRequestdispatches the new message;TestApplicationHandler.OnTestInProgressReceivedvalidates the execution id and forwards each item to the reporter.TerminalTestReporter.TestInProgressnow takes the same(assembly, tfm, arch, executionId, instanceId, uid, displayName)shape asTestCompleted.TestNodeResultsStatekeys running tests by(instanceId, uid)instead of justuid, and tracks acompletedset so a late in-progress notification can never resurrect a finished test. Retries (which get a newinstanceId) are surfaced correctly.ShowActiveTestsis enabled whenAnsiMode == AnsiIfPossibleand progress isn't suppressed (so it stays off in CI,--no-ansi,--no-progress, and LLM environments).Back-compat
The named-pipe protocol is not versioned for this change because TLV with unknown-id skip is sufficient:
NamedPipeServeris constructed withskipUnknownMessages: trueandTestApplication.OnRequestalready returnsVoidResponseforUnknownMessage, so the events are dropped silently.No protocol version bump is needed.
Producer-side gating (concern from @nohwnd)
@nohwnd flagged in #49712 that 12 parallel processes flooding
test startedevents for fast tests would be noisy. Mitigations in this PR:... and X moretrimming inTestNodeResultsState.GetRunningTasksalready handles bursty cases.The companion MTP-side PR is microsoft/testfx#8652, which actually emits the new
TestInProgressMessagesfromDotnetTestDataConsumeronInProgressTestNodeStateProperty. A further producer-side slow-test threshold (e.g. only emit after N ms) could be added there as a follow-up.Tests
TestInProgressMessagesSerializerTests— round-trip with populated and empty payloads; pins serializer id to10.TestNodeResultsStateTests— stale-add suppression after completion, retry path (newinstanceIdre-adds), distinct(instanceId, uid)keying.All 6 new tests pass.