Skip to content

Commit 22b7efd

Browse files
Fix Windows-RabbitMQ RunScenario test timeout and cascade failures (#5456)
GetThroughputPerDay loops 96 times (24*4), each requiring an HTTP call to the RabbitMQ management API plus sending and receiving 15 messages. On Windows CI, this consistently exceeds the 60-second TestTimeout that bounds all CreateTaskCompletionSource instances via testCancellationTokenSource, causing the test to fail with a timeout error mid-run. When the timeout fires while the message pump is still running, the subsequent delivery calls SetResult on an already-faulted TCS, throwing InvalidOperationException. This propagates through the RabbitMQ pump as a processing error, triggering the onError Assert.Fail, which then escalates to the critical-error handler, producing three apparent failures from one root cause. - Raise TestTimeout from 60s to 5 minutes to accommodate the test's 3-minute design budget with margin for slower Windows CI runners - Change SetResult to TrySetResult to stop the cascade when a concurrent timeout and message delivery race Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f688ec6 commit 22b7efd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ServiceControl.Transports.Tests/TransportTestFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected Task CreateTestQueue(string queueName)
185185
return configuration.TransportCustomization.ProvisionQueues(transportSettings, []);
186186
}
187187

188-
protected static TimeSpan TestTimeout = TimeSpan.FromSeconds(60);
188+
protected static TimeSpan TestTimeout = TimeSpan.FromMinutes(5);
189189

190190
protected async Task SendAndReceiveMessages(string queueName, int numMessagesToIngest)
191191
{
@@ -200,7 +200,7 @@ await StartQueueIngestor(
200200

201201
if (numMessagesIngested == numMessagesToIngest)
202202
{
203-
onMessagesProcessed.SetResult(true);
203+
onMessagesProcessed.TrySetResult(true);
204204
}
205205

206206
return Task.CompletedTask;

0 commit comments

Comments
 (0)