From f87d9dbe6208c28b2032886f3d80ac36780c540a Mon Sep 17 00:00:00 2001 From: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com> Date: Tue, 28 Jul 2026 11:59:21 +0100 Subject: [PATCH] .NET: Skip flaky InputWaiterTests timeout test blocking the merge queue InputWaiter_WaitForInputAsync_CompletesWhenTimeoutExpiresAsync races a 300ms SemaphoreSlim timeout against a 5s Task.Delay guard and asserts which one won by object identity. On the loaded net472/windows-latest leg, thread pool starvation can delay the 300ms continuation past the 5s guard, so Task.Delay wins and the assertion fails. It failed in 7 of the last 18 failed dotnet-build-and-test runs, always on net472/windows-latest and always in merge_group, blocking PRs that do not touch the workflows code. Quarantine it following the existing convention used for #5845, and track the real fix in #7360. Copilot-Session: 0be6f810-51de-4f49-b9c7-8d1c7efa2c43 --- .../InputWaiterTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/InputWaiterTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/InputWaiterTests.cs index a849b602bda..512fc71b230 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/InputWaiterTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/InputWaiterTests.cs @@ -107,7 +107,7 @@ public async Task InputWaiter_WaitForInputAsync_CanBeSignaledMultipleTimesSequen await this._waiter.WaitForInputAsync(TimeSpan.FromSeconds(1)); } - [Fact] + [Fact(Skip = "Flaky in merge_group; see https://github.com/microsoft/agent-framework/issues/7360")] public async Task InputWaiter_WaitForInputAsync_CompletesWhenTimeoutExpiresAsync() { // Verify that a finite timeout releases the block even without a signal. @@ -115,6 +115,12 @@ public async Task InputWaiter_WaitForInputAsync_CompletesWhenTimeoutExpiresAsync // we intentionally do not assert that it stays blocked until the timeout, // because that would re-introduce the same wall-clock flakiness // described in BlocksUntilSignaledAsync (see comment on that test). + // + // The generous outer bound is itself not generous enough: on the loaded + // net472/windows-latest leg, thread pool starvation can delay the 300ms + // continuation past the 5s guard, so Task.Delay wins the race and the + // identity assertion below fails. Quarantined until the assertion is + // rewritten to not depend on scheduling latency. Task waitTask = this._waiter.WaitForInputAsync(TimeSpan.FromMilliseconds(300)); Task completed = await Task.WhenAny(waitTask, Task.Delay(TimeSpan.FromSeconds(5)));