Skip to content

JobMonitor tests: Fix flaky RetryOnEntryWithCrashes_ResubmitsOnlyLatestFailedWork - #16939

Merged
premun merged 1 commit into
dotnet:mainfrom
premun:jobmonitor/fix-flaky-retry-test
Jun 2, 2026
Merged

premun merged 1 commit into
dotnet:mainfrom
premun:jobmonitor/fix-flaky-retry-test

Conversation

@premun

@premun premun commented Jun 2, 2026

Copy link
Copy Markdown
Member

Makes the RetryOnEntryWithCrashes_ResubmitsOnlyLatestFailedWork test deterministic by awaiting the completion of helix-a''s test-result upload before cancelling the runner. Without the wait, the background upload task (bound to the runner''s cancellation token) races against cts1.Cancel(), causing intermittent failures in the subsequent assertions.

Split out of #16879.

Copilot AI review requested due to automatic review settings June 2, 2026 12:25

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 makes the RetryOnEntryWithCrashes_ResubmitsOnlyLatestFailedWork JobMonitor runner test deterministic by ensuring the fake Azure DevOps “test-result upload completed” signal is observed before the runner is cancelled, eliminating a race between background upload work and cts.Cancel().

Changes:

  • Updated the test’s runner callback to await FakeAzureDevOpsService.UploadCompleted (with a bounded timeout) before cancelling the runner.
  • Added an explanatory comment documenting the specific race being avoided.

@premun
premun enabled auto-merge (squash) June 2, 2026 13:29
@premun
premun merged commit 9a93bc0 into dotnet:main Jun 2, 2026
10 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 4, 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