Repository navigation
Publish in-process retry attempts to Azure DevOps - #10845
Amaury Levé (Evangelink) merged 5 commits into
Conversation
Preserve every retry attempt, its duration, and failed-attempt attachments as ordered Azure DevOps sub-results, including when retries span multiple test hosts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsTestResultsPublisher.cs — This identity collapses distinct folded data-driven rows when they share a title. MSTest emits… |
What changed in this PR
Publishes complete in-process retry histories to Azure DevOps, including durations and attempt-specific attachments.
Changes:
- Buffers and publishes retry attempts as ordered sub-results.
- Composes in-process and cross-process retry histories.
- Adds retry publishing tests and internal API baselines.
| File | Description |
|---|---|
AzureDevOpsLivePublishingTests.cs |
Tests retry histories and attachments. |
InternalAPI.Unshipped.txt |
Tracks new internal APIs. |
AzureDevOpsTestResultsPublisher.Flush.cs |
Publishes attempts and attachments. |
AzureDevOpsTestResultsPublisher.cs |
Aggregates in-process attempts. |
AzureDevOpsResultIdStore.cs |
Stores multi-attempt histories. |
AzureDevOpsLivePublishingModels.cs |
Adds previous-attempt data. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Track concurrent retry sequences by expected attempt number and publish folded rows independently when their retry identity is ambiguous. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsTestResultsPublisher.cs — This identity collapses distinct folded data-driven rows when they share a title. MSTest emits… View resolved comment |
Suppressed comments (1)
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsTestResultsPublisher.cs:350
- Buffered attempts can be silently lost if result delivery stops before the final attempt.
SendTestResultsAsyncchecks cancellation before each result (TestExecutionManager.Runner.cs:24-32), so cancellation after reporting a superseded attempt leaves this sequence here; session finishing only flushes/counts_pendingResultsand_retryResults(AzureDevOpsTestResultsPublisher.cs:452-485), not_inProcessRetrySequences. Drain unfinished sequences into_pendingResultsbefore the final forced flush (and include them in dropped-result accounting) so already-executed attempts and their attachments are not discarded.
sequences.Add(new InProcessRetrySequence(attempt));
return null;
Drain retry sequences whose final result never arrives so executed attempts publish independently or appear in cancellation drop accounting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
Suppressed comments (1)
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsTestResultsPublisher.Flush.cs:338
- If this seed PATCH fails or is canceled, every buffered attempt except the final one is lost. The preceding POST sends only
batch[i].Result(the final outcome); the cancellation path does not requeue the creation, and the non-cancellation fallback only moves earlier attachments onto the parent without publishing their outcomes, durations, or errors. This regresses the failure handling that was safe when a seed represented only the already-POSTed result. Preserve the buffered attempts as independent results (or make their initial publication atomic) whenever seeding cannot be confirmed.
await SeedInitialAttemptsAsync(initialAttemptSeeds, deferredAttachments, cancellationToken).ConfigureAwait(false);
}
catch (OperationCanceledException ex)
{
throw new FirstAttemptSeedCanceledException(ex);
Requeue buffered earlier attempts as independent results when Azure DevOps cannot confirm the sub-result seed PATCH. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsTestResultsPublisher.Flush.cs — If the seed PATCH is canceled, only the earlier attempts are requeued here. The final attempt was… |
|
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsTestResultsPublisher.cs — The added tests only cover attempt 1 superseded followed by attempt 2 final, so no test executes… |
Retry known-parent attachment uploads at session end and cover three-attempt in-process retry aggregation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsTestResultsPublisher.cs — The added tests only cover attempt 1 superseded followed by attempt 2 final, so no test executes… View resolved comment |
|
src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/AzureDevOpsTestResultsPublisher.Flush.cs — If the seed PATCH is canceled, only the earlier attempts are requeued here. The final attempt was… View resolved comment |



Azure DevOps live publishing currently discards superseded in-process MSTest
[Retry]executions. This hides failed attempts, reports incomplete duration data, and makes attachments such as Playwright traces inaccessible when a later attempt passes.This change buffers in-process executions until the final outcome is known, then publishes the complete ordered history as
rerunsub-results. Per-attempt durations and attachments flow through the existing sub-result ID mapping, and the same model composes with cross-process--retry-failed-testsattempts. Ambiguous folded data-driven rows, incomplete sequences, and attempts whose sub-result seed cannot be confirmed fall back to independent results so their diagnostics are preserved without being cross-wired. Final-attempt attachments retain their known parent target across seed cancellation and retry during session finalization.Validation:
Attempt# 0retained its downloaded attachment, passingAttempt# 1had none, and the parent had no misplaced attachments.Fixes: #10839