Skip to content

Fix flaky .NET ask-user E2E tests - #2107

Merged
SteveSandersonMS merged 2 commits into
mainfrom
copilot/fix-dotnet-ask-user-flake
Jul 28, 2026
Merged

Fix flaky .NET ask-user E2E tests#2107
SteveSandersonMS merged 2 commits into
mainfrom
copilot/fix-dotnet-ask-user-flake

Conversation

@SteveSandersonMS

@SteveSandersonMS SteveSandersonMS commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use SendAndWaitAsync for the two .NET ask-user callback tests
  • install the completion subscription before sending instead of relying on post-send event backfill
  • use the standard 60-second SendAndWaitAsync timeout

Failure analysis

Run 30350279994 / job 90245871596 failed only on windows-latest when Should_Receive_Choices_In_User_Input_Request timed out in TestHelper.GetFinalAssistantMessageAsync. The triggering commit changed only documentation, the immediately preceding Windows run passed, and the sibling ask-user test completed in one second, so this is a synchronization flake rather than a product regression or generally slow runner.

The tests called SendAsync before subscribing for assistant/idle events, leaving a window where completion events had to be recovered through a separate GetEventsAsync backfill. SendAndWaitAsync subscribes before sending and is already used by the equivalent Node/Python tests and the third C# ask-user test.

Validation

  • dotnet format --verify-no-changes --no-restore
  • dotnet build --no-restore
  • 176 .NET unit tests
  • all 3 ask-user E2E tests, including 10 consecutive focused runs

Subscribe for completion events before sending ask-user prompts by using SendAndWaitAsync. This removes the post-send event backfill race that caused the Windows test to time out waiting for an assistant message.

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

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 synchronization flakes in two .NET ask-user E2E tests.

Changes:

  • Replaces post-send event backfill with SendAndWaitAsync.
  • Preserves the 120-second Windows timeout.
Show a summary per file
File Description
dotnet/test/E2E/AskUserE2ETests.cs Subscribes for completion before sending in two ask-user tests.

Review details

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

@github-actions

Copy link
Copy Markdown
Contributor

SDK Consistency Review ✅

This PR modifies only .NET E2E test code (dotnet/test/E2E/AskUserE2ETests.cs) — no public SDK API surface is changed.

The fix aligns the two updated tests with the pattern already used by Node.js and Python equivalents (and the third C# ask-user test), so this improves cross-SDK test consistency rather than introducing any divergence.

No cross-language changes are needed.

Generated by SDK Consistency Review Agent for #2107 · sonnet46 15.9 AIC · ⌖ 5.32 AIC · ⊞ 6.6K ·

Let SendAndWaitAsync apply its standard 60-second timeout instead of retaining the legacy helper's explicit 120-second timeout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 28, 2026 11:22

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.

Review details

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

@github-actions github-actions Bot mentioned this pull request Jul 28, 2026
@SteveSandersonMS
SteveSandersonMS merged commit 0d48467 into main Jul 28, 2026
25 checks passed
@SteveSandersonMS
SteveSandersonMS deleted the copilot/fix-dotnet-ask-user-flake branch July 28, 2026 11:48
edburns pushed a commit that referenced this pull request Aug 4, 2026
edburns pushed a commit that referenced this pull request Aug 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.

2 participants