mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Improve TestSSH reliability on macOS (#3067)
Related issue: https://github.com/coder/coder/issues/2122
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user