From b3bfc162d3a3b15d6bcd2c685f0d69404c04ab1b Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 17 Jan 2023 14:58:23 +0000 Subject: [PATCH] test: Improve TestSSH/ForwardAgent stability on macOS --- cli/ssh_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/ssh_test.go b/cli/ssh_test.go index dc09e0d84f45a..137851d437b35 100644 --- a/cli/ssh_test.go +++ b/cli/ssh_test.go @@ -274,6 +274,10 @@ func TestSSH(t *testing.T) { assert.NoError(t, err, "ssh command failed") }) + // Wait for the prompt or any output really to indicate the command has + // started and accepting input on stdin. + _ = pty.Peek(ctx, 1) + // Ensure that SSH_AUTH_SOCK is set. // Linux: /tmp/auth-agent3167016167/listener.sock // macOS: /var/folders/ng/m1q0wft14hj0t3rtjxrdnzsr0000gn/T/auth-agent3245553419/listener.sock