Closed
Description
ssh_test.go:422: 2023-10-10 10:59:28.184: cmd: read error: match deadline exceeded: context deadline exceeded (wanted "hello world"; got "==> ⧗ Running workspace agent startup scripts (non-blocking)\r\ncurl localhost:8222\r\nNotice: The startup scripts are still running and your workspace may be incomplete.\r\nFor more information and troubleshooting, see https://coder.com/docs/v2/latest/templates#your-workspace-may-be-incomplete and https://coder.com/docs/coder-oss/latest/templates#troubleshooting-templates\r\n")
ssh_test.go:422:
Error Trace: /home/runner/actions-runner/_work/coder/coder/pty/ptytest/ptytest.go:347
/home/runner/actions-runner/_work/coder/coder/pty/ptytest/ptytest.go:177
/home/runner/actions-runner/_work/coder/coder/pty/ptytest/ptytest.go:153
/home/runner/actions-runner/_work/coder/coder/cli/ssh_test.go:422
Error: read error
Test: TestSSH/RemoteForward
Messages: match deadline exceeded: context deadline exceeded (wanted "hello world"; got "==> ⧗ Running workspace agent startup scripts (non-blocking)\r\ncurl localhost:8222\r\nNotice: The startup scripts are still running and your workspace may be incomplete.\r\nFor more information and troubleshooting, see https://coder.com/docs/v2/latest/templates#your-workspace-may-be-incomplete and https://coder.com/docs/coder-oss/latest/templates#troubleshooting-templates\r\n")
Seen on https://github.com/coder/coder/actions/runs/6468296837/job/17560058112?pr=10164
I think the issue is that the test just peeks a single character as evidence that the SSH session is ready for input
// Wait for the prompt or any output really to indicate the command has
// started and accepting input on stdin.
_ = pty.Peek(ctx, 1)
// Download the test page
pty.WriteLine("curl localhost:8222")
pty.ExpectMatch("hello world")
but that's not always the case because we are getting notices about startup scripts running.