From cc68c66c9524b37609f3cf48afff52c1853200fe Mon Sep 17 00:00:00 2001 From: Laura Brehm Date: Wed, 24 Jul 2024 10:31:45 +0100 Subject: [PATCH] tests: fix flaxy `TestCloseRunningCommand` test Looks like this test was failing due to bad syntax on the `while` loop, which caused it to die after 1 second. If the test took a bit longer, the process would be dead before the following assertions run, causing the test to fail/be flaky. Signed-off-by: Laura Brehm --- cli/connhelper/commandconn/commandconn_unix_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/connhelper/commandconn/commandconn_unix_test.go b/cli/connhelper/commandconn/commandconn_unix_test.go index baa70cce82..40f5afecf5 100644 --- a/cli/connhelper/commandconn/commandconn_unix_test.go +++ b/cli/connhelper/commandconn/commandconn_unix_test.go @@ -48,7 +48,7 @@ func TestCloseRunningCommand(t *testing.T) { defer close(done) go func() { - c, err := New(ctx, "sh", "-c", "while true; sleep 1; done") + c, err := New(ctx, "sh", "-c", "while true; do sleep 1; done") assert.NilError(t, err) cmdConn := c.(*commandConn) assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))