mirror of https://github.com/docker/cli.git
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:
parent
482bf8613c
commit
cc68c66c95
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue