fix: Improve TestSSH reliability on macOS (#3067)

Related issue: https://github.com/coder/coder/issues/2122
This commit is contained in:
Mathias Fredriksson
2022-07-20 19:24:15 +03:00
committed by GitHub
parent 6199e6a060
commit 4fde5366be

View File

@ -91,6 +91,9 @@ func TestSSH(t *testing.T) {
// Shells on Mac, Windows, and Linux all exit shells with the "exit" command.
pty.WriteLine("exit")
// Read output to prevent hang on macOS, see:
// https://github.com/coder/coder/issues/2122
pty.ExpectMatch("exit")
<-cmdDone
})
t.Run("Stdio", func(t *testing.T) {
@ -224,6 +227,9 @@ func TestSSH(t *testing.T) {
// And we're done.
pty.WriteLine("exit")
// Read output to prevent hang on macOS, see:
// https://github.com/coder/coder/issues/2122
pty.ExpectMatch("exit")
<-cmdDone
})
}