Skip to content

Commit 6fecd4a

Browse files
stephentoubCopilot
andcommitted
Bump default .NET test helper timeout from 60s to 120s for Windows CI
Should_Work_With_Approve_All_Permission_Handler timed out on the windows-latest .NET CI job at the previous default of 60s while waiting for the first assistant message in the PermissionTests fixture. The CLI / replay-proxy cold-start cost on the first test of a fixture can exceed 60s on Windows GitHub Actions runners; subsequent tests in the same fixture run in well under a second. McpAndAgentsTests.cs already had to bump to 120s explicitly for the same reason. Apply the same 120s default in TestHelper so individual tests don't have to opt in. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b6ec90d commit 6fecd4a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

dotnet/test/Harness/TestHelper.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ namespace GitHub.Copilot.SDK.Test.Harness;
66

77
public static class TestHelper
88
{
9+
// Default tolerates CLI / replay-proxy cold start on Windows GitHub Actions
10+
// runners, where the first test in a fixture can take ~60s before the first
11+
// assistant message arrives. Subsequent tests in the same fixture typically
12+
// complete in well under a second.
13+
private static readonly TimeSpan DefaultEventTimeout = TimeSpan.FromSeconds(120);
14+
915
public static async Task<AssistantMessageEvent?> GetFinalAssistantMessageAsync(
1016
CopilotSession session,
1117
TimeSpan? timeout = null,
1218
bool alreadyIdle = false)
1319
{
1420
var tcs = new TaskCompletionSource<AssistantMessageEvent>(TaskCreationOptions.RunContinuationsAsynchronously);
15-
using var cts = new CancellationTokenSource(timeout ?? TimeSpan.FromSeconds(60));
21+
using var cts = new CancellationTokenSource(timeout ?? DefaultEventTimeout);
1622

1723
// Both `finalAssistantMessage` and `sawIdle` are set from two threads — the
1824
// subscription callback (CLI read loop) and CheckExistingMessages (RPC reply).
@@ -111,7 +117,7 @@ public static async Task<T> GetNextEventOfTypeAsync<T>(
111117
TimeSpan? timeout = null) where T : SessionEvent
112118
{
113119
var tcs = new TaskCompletionSource<T>(TaskCreationOptions.RunContinuationsAsynchronously);
114-
using var cts = new CancellationTokenSource(timeout ?? TimeSpan.FromSeconds(60));
120+
using var cts = new CancellationTokenSource(timeout ?? DefaultEventTimeout);
115121

116122
using var subscription = session.On(evt =>
117123
{

0 commit comments

Comments
 (0)