You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because records are keyed by uid, folded data-driven rows can share this key. If one shared-UID row is a final failure or skip and a later row passes, the non-passing path removes the only failure marker and this expression can mark the pass as flaky, even though the UID had a mixed final outcome rather than a recovered retry. The GitHub Actions reporter keeps a sticky _notRecoveredTests state and clears flaky records for this case; mirror that behavior here or distinguish final rows.
Fall back to exception messages for blank explanations
Explanation can be an empty or whitespace-only string. In that case ?? selects the blank value and discards exception.Message, so the expandable summary may show only an exception type and no diagnostic message. The corresponding GitHub capture treats whitespace-only explanations as absent; use the same fallback here.
Each historical count is validated independently as a non-negative int, so a valid fragment can contain int.MaxValue for both counts. Their sum overflows here and can render a negative total or fail while producing the report. Accumulate the two counts as long before formatting.
Disambiguate history and dependency rows across modules
When more than one module is aggregated, this helper qualifies rows only with the assembly name. Two target frameworks or architectures of the same test assembly therefore produce indistinguishable history or dependency rows even though their statistics and edges can differ. Include the target framework/architecture (or the full module discriminator used by the section headings) in this label.
Reject null history entries as malformed fragments
Unlike the dependency validation below, this new HistoryTests predicate dereferences every element without checking for null. A fragment containing historyTests: [null] therefore throws NullReferenceException instead of being rejected as a FormatException, preventing malformed-fragment handling from working as intended.
Final test-triage resolution — Azure Pipelines build 1600003
Superseding my preliminary comment. Build leg microsoft.testfx (Build Windows Debug) — job "Windows Debug" / task "Test (unit tests only)" failed on both the net462 and .NET Framework 4.8 matrix legs (net8.0/net9.0 legs passed).
Both legs failed with the same assertion signature: the captured JSON diagnostics artifact was missing the "cpuPercentDuringTest" field.
Not caused by this PR — PR #11337 does not touch TestContextImplementation.AssertionFailureDiagnostics.* or this test file. History shows the same test previously failed on main build 1599509 (net462 leg only), so this is a pre-existing, recurring defect rather than a one-off caused by this change.
Root cause (high confidence): in src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.AssertionFailureDiagnostics.Writer.cs, CreateProcessArtifact computes:
When the captured test runs fast enough that elapsed rounds to TimeSpan.Zero (common on .NET Framework, which has coarser timer resolution), CpuPercentDuringTest is set to null. Since the [DataMember(..., EmitDefaultValue = false)] attribute on that property omits null values from serialization, the "cpuPercentDuringTest" key is dropped from the JSON entirely, which trips the test's json.Should().Contain("\"cpuPercentDuringTest\"") assertion. This is a deterministic race between measured elapsed time and serialization behavior, not environmental flakiness.
Next step: either always emit cpuPercentDuringTest (drop EmitDefaultValue = false for this property, or emit 0 instead of null when elapsed is effectively zero), or relax the test assertion to tolerate a missing field when elapsed time rounds to zero. Creating a tracking issue since this is a durable, previously recurring defect in the shared framework code.
🤖 Automated content by GitHub Copilot. Generated by the Pipeline Test Triage workflow. · copilot · auto · 127.1 AIC · ⌖ 6.46 AIC · ⊞ 9.4K
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
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.
Summary
Validation
Microsoft.Testing.Extensions.UnitTestsacross its configured target frameworksMicrosoft.Testing.Extensions.VSTestBridge.UnitTestsacross its configured target frameworks