Skip to content

Commit 0d48467

Browse files
Fix flaky .NET ask-user E2E tests (#2107)
1 parent 5a887d7 commit 0d48467

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

dotnet/test/E2E/AskUserE2ETests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ public async Task Should_Invoke_User_Input_Handler_When_Model_Uses_Ask_User_Tool
3030
}
3131
});
3232

33-
await session.SendAsync(new MessageOptions
33+
await session.SendAndWaitAsync(new MessageOptions
3434
{
3535
Prompt = "Ask me to choose between 'Option A' and 'Option B' using the ask_user tool. Wait for my response before continuing."
3636
});
3737

38-
await TestHelper.GetFinalAssistantMessageAsync(session);
39-
4038
// Should have received at least one user input request
4139
Assert.NotEmpty(userInputRequests);
4240

@@ -62,13 +60,11 @@ public async Task Should_Receive_Choices_In_User_Input_Request()
6260
}
6361
});
6462

65-
await session.SendAsync(new MessageOptions
63+
await session.SendAndWaitAsync(new MessageOptions
6664
{
6765
Prompt = "Use the ask_user tool to ask me to pick between exactly two options: 'Red' and 'Blue'. These should be provided as choices. Wait for my answer."
6866
});
6967

70-
await TestHelper.GetFinalAssistantMessageAsync(session);
71-
7268
// Should have received a request
7369
Assert.NotEmpty(userInputRequests);
7470

0 commit comments

Comments
 (0)