From 04d5ff88e41e754f07d76d8770a7aef2ea6da3d5 Mon Sep 17 00:00:00 2001 From: Ethan <39577870+ethanndickson@users.noreply.github.com> Date: Tue, 9 Dec 2025 00:48:47 +1100 Subject: [PATCH] test: bump TestAgent_SessionTTYShell timeout (#21155) ## Problem The `TestAgent_SessionTTYShell` test was flaking on macOS CI runners with: ``` match deadline exceeded: context deadline exceeded (wanted 1 bytes; got 0: "") ``` The test uses `WaitShort` (10s) for the context timeout when waiting for shell prompt output via `Peek(ctx, 1)`. On slow macOS CI runners, the shell startup can exceed this timeout due to resource contention. This is evidenced in the failure logs, the SSH session was not reported by the agent until the 10s timeout is nearly up - it took a while to connect. ## Solution Increase the timeout from `WaitShort` (10s) to `WaitMedium` (30s). This matches the timeout used by `ExpectMatch` internally and gives the shell more time to initialize on slow CI machines. --- This PR was entirely generated by [mux](https://github.com/coder/mux) but reviewed by a human. Closes https://github.com/coder/internal/issues/1177 --- agent/agent_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/agent_test.go b/agent/agent_test.go index d4d40b56bb..d4c8b56831 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -465,7 +465,7 @@ func TestAgent_SessionTTYShell(t *testing.T) { for _, port := range sshPorts { t.Run(fmt.Sprintf("(%d)", port), func(t *testing.T) { t.Parallel() - ctx := testutil.Context(t, testutil.WaitShort) + ctx := testutil.Context(t, testutil.WaitMedium) session := setupSSHSessionOnPort(t, agentsdk.Manifest{}, codersdk.ServiceBannerConfig{}, nil, port) command := "sh"