Preserve inner exceptions in server mode - #11221
Amaury Levé (Evangelink) merged 2 commits into
Conversation
Flatten exception chains into the existing JSON-RPC error fields across both serializer implementations and cover aggregate exceptions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new internal helper is missing from InternalAPI.Unshipped.txt, causing RS0016.
Get a fresh assessment by requesting another Copilot review.
Review tier: Balanced (auto)
Findings: 1
Note
Copilot is running an experiment and ran this review at Balanced.
Open findings (1)
What changed in this PR
Preserves nested exception details in server-mode JSON-RPC responses across both serializers and the source-only client package.
Changes:
- Flattens nested and aggregate exception messages and stack traces.
- Applies formatting to failed, error, timed-out, and canceled states.
- Adds cross-serializer tests.
| File | Description |
|---|---|
FormatterUtilitiesTests.cs |
Tests nested and aggregate exceptions. |
SerializerUtilities.TestNodeSerializers.cs |
Adds shared exception formatting. |
Json.TestNodeSerializer.cs |
Uses shared formatting for System.Text.Json. |
Microsoft.Testing.Platform.ServerMode.Client.Sources.csproj |
Links the exception flattener into the source package. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Add the new internal SerializerUtilities helper to the unshipped API baseline. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🧵 Parallel-safety audit — PR #11221Parallelization — one row per test assembly audited:
Findings: A (global-state) The PR only touches Both new tests are self-contained and deterministic:
No parallel-safety issues to flag under the detected Advisory only — heuristic, non-blocking. Re-run with
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The serializers, linked-source package, API baseline, and affected failure states are consistently covered.
Review tier: Balanced (auto)
Findings: None
Note
Copilot is running an experiment and ran this review at Balanced.
Resolved findings (1)
🧪 Expert test review — PR #11221
Summary: 2 new test methods reviewed, both grade A. They give solid pseudo-mutation coverage of the new This advisory comment was generated automatically. Grades are heuristic and informational — they do not block merging. Suggestions on the Files changed tab can be applied with one click. Re-run with
|

Server-mode JSON-RPC currently sends only the outer exception message and stack trace, so IDE clients lose the underlying failure details that terminal and
dotnet testoutput already preserve.This change keeps the existing protocol shape while flattening exception details into
error.messageanderror.stacktracefor failed, error, timed-out, and canceled test nodes. Both the System.Text.Json and Jsonite serializers use the same formatting helper, backed by the existingExceptionFlattener. The source-only server client package now includes that shared helper as well.Tests cover nested exceptions across all affected states and multi-branch
AggregateExceptionoutput on both serializer implementations.Validation:
Microsoft.Testing.Platform.UnitTestsFormatterUtilitiesTests: 84/84 passed on net8.0Microsoft.Testing.Platform.UnitTestsFormatterUtilitiesTests: 84/84 passed on net462Microsoft.Testing.Platform.ServerMode.Client.Sourcesbuilds successfullyFixes: #11202