Skip to content

Add verbose Helix test-result upload diagnostics - #17282

Merged
mmitche merged 3 commits into
dotnet:mainfrom
mmitche:dev/helix-upload-hang-diagnostics-pr
Aug 7, 2026
Merged

mmitche merged 3 commits into
dotnet:mainfrom
mmitche:dev/helix-upload-hang-diagnostics-pr

Conversation

@mmitche

@mmitche mmitche commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • report pending upload phases and elapsed time while draining
  • log semaphore waits, downloads, XML parsing, and Azure DevOps HTTP attempts under --verbose`n- expose and log the actual exponential-backoff delay, including server-provided retry delays

Addresses the observability gaps described in #17280.

Testing

  • targeted Microsoft.Arcade.Common.Tests exponential retry tests
  • targeted Helix job monitor, Azure DevOps service, publisher, and Helix service tests

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
Copilot AI review requested due to automatic review settings August 7, 2026 15:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
Copilot AI review requested due to automatic review settings August 7, 2026 16:19
missymessa
missymessa previously approved these changes Aug 7, 2026

@missymessa missymessa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM shipit

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; }

@mmitche
mmitche enabled auto-merge (squash) August 7, 2026 16:30
Copilot AI review requested due to automatic review settings August 7, 2026 16:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@mmitche
mmitche merged commit 56e1007 into dotnet:main Aug 7, 2026
9 of 12 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants