Skip to content

Commit 4fde536

Browse files
authored
fix: Improve TestSSH reliability on macOS (#3067)
Related issue: #2122
1 parent 6199e6a commit 4fde536

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/ssh_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ func TestSSH(t *testing.T) {
9191

9292
// Shells on Mac, Windows, and Linux all exit shells with the "exit" command.
9393
pty.WriteLine("exit")
94+
// Read output to prevent hang on macOS, see:
95+
// https://github.com/coder/coder/issues/2122
96+
pty.ExpectMatch("exit")
9497
<-cmdDone
9598
})
9699
t.Run("Stdio", func(t *testing.T) {
@@ -224,6 +227,9 @@ func TestSSH(t *testing.T) {
224227

225228
// And we're done.
226229
pty.WriteLine("exit")
230+
// Read output to prevent hang on macOS, see:
231+
// https://github.com/coder/coder/issues/2122
232+
pty.ExpectMatch("exit")
227233
<-cmdDone
228234
})
229235
}

0 commit comments

Comments
 (0)