Skip to content

Fix flaky DiagnosticTests on net10.0 by waiting for specific activities#1324

Merged
stephentoub merged 2 commits intomainfrom
copilot/fix-ci-failure-1320
Feb 20, 2026
Merged

Fix flaky DiagnosticTests on net10.0 by waiting for specific activities#1324
stephentoub merged 2 commits intomainfrom
copilot/fix-ci-failure-1320

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

DiagnosticTests.Session_TracksActivities fails intermittently on net10.0 due to a race condition. Server messages are processed via fire-and-forget tasks, and the WaitForAsync conditions used activity count thresholds (>= 4) that could be satisfied by other server activities before the expected tools/call activity was exported.

  • Changed all three WaitForAsync conditions to wait for the specific activities the assertions require, rather than a server activity count
// Before: count-based, racy
await WaitForAsync(() => activities.Count(a => a.Kind == ActivityKind.Server) >= 4);

// After: waits for the exact activity needed
await WaitForAsync(() => activities.Any(a =>
    a.DisplayName == "tools/call DoubleValue" && a.Kind == ActivityKind.Server));

This failure also reproduces on main — it is not caused by #1320.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…of counts

The WaitForAsync conditions used activity count thresholds (>= 4) which
could be satisfied by other server activities before the expected ones
were exported, causing intermittent failures on net10.0. Changed to
wait for the specific activities that the assertions need.

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate and fix CI failure for PR 1320 Fix flaky DiagnosticTests on net10.0 by waiting for specific activities Feb 20, 2026
Copilot AI requested a review from stephentoub February 20, 2026 02:28
@stephentoub stephentoub marked this pull request as ready for review February 20, 2026 03:05
@stephentoub stephentoub enabled auto-merge (squash) February 20, 2026 03:05
@stephentoub stephentoub requested a review from halter73 February 20, 2026 03:05
@stephentoub stephentoub merged commit d9ae6bc into main Feb 20, 2026
10 checks passed
@stephentoub stephentoub deleted the copilot/fix-ci-failure-1320 branch February 20, 2026 03:42
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

Comments