Skip to content

Fix flaky .NET session resume E2E test - #2109

Merged
SteveSandersonMS merged 1 commit into
mainfrom
copilot/fix-dotnet-resume-e2e-flake
Jul 28, 2026
Merged

Fix flaky .NET session resume E2E test#2109
SteveSandersonMS merged 1 commit into
mainfrom
copilot/fix-dotnet-resume-e2e-flake

Conversation

@SteveSandersonMS

Copy link
Copy Markdown
Contributor

Summary

  • use SendAndWaitAsync for the initial message in the .NET session-resume E2E test
  • install the completion subscription before sending so fast assistant/idle events cannot be missed
  • preserve the existing resume-event and stateful-continuation assertions

Failure analysis

Run 30356278419 / job 90265115048 failed only in Should_Resume_A_Session_Using_A_New_Client, which timed out for two minutes in TestHelper.GetFinalAssistantMessageAsync while waiting for the initial 1+1 response. The remaining 457 tests passed.

The test called SendAsync before installing the helper subscription. A fast response could therefore deliver its assistant and idle events before the subscription existed, leaving completion dependent on a separate post-send GetEventsAsync backfill. This is the same synchronization race addressed for the ask-user tests in #2107. SendAndWaitAsync subscribes before sending and removes that window.

Validation

  • dotnet format --verify-no-changes --no-restore
  • dotnet build --no-restore
  • 178 .NET unit tests

Subscribe for completion events before sending the initial prompt so a fast response cannot be missed between SendAsync and the post-send test helper subscription.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 28, 2026 13:09
@SteveSandersonMS
SteveSandersonMS requested a review from a team as a code owner July 28, 2026 13:09

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

Fixes a race in the .NET session-resume E2E test by subscribing before sending the initial message.

Changes:

  • Replaces separate send/wait calls with SendAndWaitAsync.
  • Preserves resume and continuation assertions.
Show a summary per file
File Description
dotnet/test/E2E/SessionE2ETests.cs Makes initial response handling race-safe.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread dotnet/test/E2E/SessionE2ETests.cs
@github-actions github-actions Bot mentioned this pull request Jul 28, 2026
@SteveSandersonMS
SteveSandersonMS merged commit 73b9460 into main Jul 28, 2026
25 checks passed
@SteveSandersonMS
SteveSandersonMS deleted the copilot/fix-dotnet-resume-e2e-flake branch July 28, 2026 13:32
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.

2 participants