From 9a023dd63b63f72b2653cbc2d1fb37ca8763db03 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Wed, 3 Aug 2022 13:37:12 +0300 Subject: [PATCH] fix: Skip waiting for exit output in SSH test (#3368) This seems to have caused flakes on Windows, the reason could be that the input is lost due to writing to stdin before the shell is ready, or simply that the command wasn't echoed (for the same reason). We no longer need to consume the output since #2122 has been fixed, so this might remove the flake in the latter case. Ideally we would wait for the prompt to be present, but since we are spawning the users shell, we have no control of what the prompt looks like. In CI we can make assumption but even then it could change in the future. --- cli/ssh_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cli/ssh_test.go b/cli/ssh_test.go index 059df85309..64c02bb2d5 100644 --- a/cli/ssh_test.go +++ b/cli/ssh_test.go @@ -86,6 +86,7 @@ func TestSSH(t *testing.T) { assert.NoError(t, err) }) pty.ExpectMatch("Waiting") + agentClient := codersdk.New(client.URL) agentClient.SessionToken = agentToken agentCloser := agent.New(agentClient.ListenWorkspaceAgent, &agent.Options{ @@ -97,9 +98,6 @@ 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) {