Skip to content

Commit 9a023dd

Browse files
authored
fix: Skip waiting for exit output in SSH test (#3368)
This seems to have caused flakes on Windows, the reason could be that the input is lost due to writing to stdin before the shell is ready, or simply that the command wasn't echoed (for the same reason). We no longer need to consume the output since #2122 has been fixed, so this might remove the flake in the latter case. Ideally we would wait for the prompt to be present, but since we are spawning the users shell, we have no control of what the prompt looks like. In CI we can make assumption but even then it could change in the future.
1 parent 1d6283b commit 9a023dd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cli/ssh_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func TestSSH(t *testing.T) {
8686
assert.NoError(t, err)
8787
})
8888
pty.ExpectMatch("Waiting")
89+
8990
agentClient := codersdk.New(client.URL)
9091
agentClient.SessionToken = agentToken
9192
agentCloser := agent.New(agentClient.ListenWorkspaceAgent, &agent.Options{
@@ -97,9 +98,6 @@ func TestSSH(t *testing.T) {
9798

9899
// Shells on Mac, Windows, and Linux all exit shells with the "exit" command.
99100
pty.WriteLine("exit")
100-
// Read output to prevent hang on macOS, see:
101-
// https://github.com/coder/coder/issues/2122
102-
pty.ExpectMatch("exit")
103101
<-cmdDone
104102
})
105103
t.Run("Stdio", func(t *testing.T) {

0 commit comments

Comments
 (0)