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 <laurabrehm@hey.com>
This commit is contained in:
Laura Brehm 2024-07-24 10:31:45 +01:00
parent 482bf8613c
commit cc68c66c95
No known key found for this signature in database
GPG Key ID: 08EC1B0491948487
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ func TestCloseRunningCommand(t *testing.T) {
defer close(done) defer close(done)
go func() { 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) assert.NilError(t, err)
cmdConn := c.(*commandConn) cmdConn := c.(*commandConn)
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid)) assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))