Repository navigation
Add verbose Helix test-result upload diagnostics - #17282
Conversation
Report upload phases, elapsed time, semaphore waits, file parsing and download progress, HTTP attempts, and actual exponential retry delays when verbose logging is enabled. Co-authored-by: Copilot <[email protected]> Copilot-Session: fc3e75dd-9161-4fd8-83b6-80c56a4a096f
There was a problem hiding this comment.
Pull request overview
This PR improves observability of Helix test-result uploads during the Job Monitor “drain” phase by adding verbose progress/phase reporting, timing diagnostics, and richer retry/backoff logging across Helix download, AzDO publishing, and HTTP retry paths.
Changes:
- Add verbose drain heartbeat that periodically reports pending upload count, per-job phase, and phase/total elapsed time.
- Add detailed debug logging for key upload phases (semaphore waits, downloads, XML parsing, HTTP attempts) and expose/log computed exponential backoff delays (including retry-after influence).
- Add/extend targeted tests for the new retry-delay callback and verbose drain reporting.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/JobMonitorRunnerTests.cs | Adds a new test validating verbose drain heartbeat output includes phase and elapsed time. |
| src/Microsoft.DotNet.Helix/JobMonitor/TestResultUploadQueue.cs | Tracks per-upload phase/timing and emits verbose drain heartbeat logs while awaiting pending uploads. |
| src/Microsoft.DotNet.Helix/JobMonitor/Services/HelixService.cs | Adds debug logs and retry-delay diagnostics for Helix download/retry operations. |
| src/Microsoft.DotNet.Helix/JobMonitor/Services/AzureDevOpsService.cs | Adds debug timing for semaphore waits and retry-delay diagnostics for AzDO HTTP attempts. |
| src/Microsoft.DotNet.Helix/AzureDevOpsTestPublisher/AzureDevOpsResultPublisher.cs | Adds debug logs for TRX parsing and detailed AzDO HTTP attempt/elapsed/retry-delay logging. |
| src/Common/Microsoft.Arcade.Common/ExponentialRetry.cs | Adds a callback to surface the actual computed retry delay (after max/Retry-After handling). |
| src/Common/Microsoft.Arcade.Common.Tests/ExponentialRetryTests.cs | Adds a unit test validating the new retry-delay callback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (3)
src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/JobMonitorRunnerTests.cs:573
- This test relies on a fixed 1200ms delay to ensure DrainAsync has started while the upload is still blocked, which can be flaky on slower/contended CI. Wait for the drain "Waiting for ... pending" log message (or another deterministic signal) before releasing the upload blocker instead of sleeping a fixed duration.
await azdo.UploadStarted.Task.WaitAsync(TimeSpan.FromSeconds(5));
await Task.Delay(TimeSpan.FromMilliseconds(1200));
uploadRelease.SetResult();
src/Microsoft.DotNet.Helix/JobMonitor/TestResultUploadQueue.cs:359
- PendingUpload.Task is never initialized in the constructor and is dereferenced without null checks (e.g., Prune/DrainAsync). Today it's set before adding to _pending, but leaving it uninitialized makes future refactors prone to NullReferenceException. Initialize it to a safe default to make the type robust.
public DateTimeOffset StartedAt { get; }
public Task Task { get; set; }
src/Common/Microsoft.Arcade.Common/ExponentialRetry.cs:41
- RetryDelayCallback's XML doc says the callback receives the "computed" delay, but the implementation passes the actual delay that will be awaited (it may be increased by RetryAfter and capped by MaximumDelay). Clarify the doc to match the behavior so callers/logs interpret the value correctly.
/// <summary>
/// Invoked after a failed attempt when another attempt will be made. The first argument
/// is the one-based number of the failed attempt and the second is the computed delay.
/// </summary>
public Action<int, TimeSpan>? RetryDelayCallback { get; set; }

Summary
Addresses the observability gaps described in #17280.
Testing