test: remove finite timeout in BlocksUntilSignaledAsync to fix race

Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/962b7404-4266-4a16-906c-ba3e607c2764

Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-14 03:50:26 +00:00
committed by GitHub
Unverified
parent fbccad091b
commit 69858b5a16
@@ -34,7 +34,12 @@ public sealed class InputWaiterTests : IDisposable
[Fact]
public async Task InputWaiter_WaitForInputAsync_BlocksUntilSignaledAsync()
{
Task waitTask = this._waiter.WaitForInputAsync(TimeSpan.FromSeconds(5));
// Use the no-timeout overload: the wait must only be released by SignalInput.
// Passing a finite timeout here is racy on slow hosts: if the test thread is
// paused longer than the timeout (e.g., heavy CI load or GC) before the
// assertion runs, SemaphoreSlim's internal timer fires and waitTask completes
// on its own, causing the "should not complete before signaled" check to flake.
Task waitTask = this._waiter.WaitForInputAsync(CancellationToken.None);
Task completedBeforeSignal = await Task.WhenAny(waitTask, Task.Delay(100));
completedBeforeSignal.Should().NotBeSameAs(