From 370b08cafe6a25870ec09264acf38ee71532bbb9 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Wed, 20 Jul 2022 19:11:23 +0300 Subject: [PATCH] fix: Improve TestSSH reliability on macOS Related issue: https://github.com/coder/coder/issues/2122 --- cli/ssh_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/ssh_test.go b/cli/ssh_test.go index 171907ee06155..c5849e99eada6 100644 --- a/cli/ssh_test.go +++ b/cli/ssh_test.go @@ -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 }) }