Skip to content

Commit 04d5ff8

Browse files
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 coder/internal#1177
1 parent 5224355 commit 04d5ff8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ func TestAgent_SessionTTYShell(t *testing.T) {
465465
for _, port := range sshPorts {
466466
t.Run(fmt.Sprintf("(%d)", port), func(t *testing.T) {
467467
t.Parallel()
468-
ctx := testutil.Context(t, testutil.WaitShort)
468+
ctx := testutil.Context(t, testutil.WaitMedium)
469469

470470
session := setupSSHSessionOnPort(t, agentsdk.Manifest{}, codersdk.ServiceBannerConfig{}, nil, port)
471471
command := "sh"

0 commit comments

Comments
 (0)