Fix flaky .NET ask-user E2E tests - #2107
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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
Contributor
SDK Consistency Review ✅This PR modifies only 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.
|
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>
edburns
pushed a commit
that referenced
this pull request
Aug 4, 2026
edburns
pushed a commit
that referenced
this pull request
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SendAndWaitAsyncfor the two .NET ask-user callback testsSendAndWaitAsynctimeoutFailure analysis
Run 30350279994 / job 90245871596 failed only on
windows-latestwhenShould_Receive_Choices_In_User_Input_Requesttimed out inTestHelper.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
SendAsyncbefore subscribing for assistant/idle events, leaving a window where completion events had to be recovered through a separateGetEventsAsyncbackfill.SendAndWaitAsyncsubscribes 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-restoredotnet build --no-restore