From 4fde5366beb68207f00e32732b3ffe408d6ecf31 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Wed, 20 Jul 2022 19:24:15 +0300 Subject: [PATCH] fix: Improve TestSSH reliability on macOS (#3067) 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 171907ee06..c5849e99ea 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 }) }