Skip to content

Commit 2e506cb

Browse files
authored
Merge pull request #5293 from laurazard/27-backport-flaky-tests
[27.0 backport] tests: fix flaxy TestCloseRunningCommand test
2 parents 1b2782e + 7f02bc9 commit 2e506cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/connhelper/commandconn/commandconn_unix_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestCloseRunningCommand(t *testing.T) {
4848
defer close(done)
4949

5050
go func() {
51-
c, err := New(ctx, "sh", "-c", "while true; sleep 1; done")
51+
c, err := New(ctx, "sh", "-c", "while true; do sleep 1; done")
5252
assert.NilError(t, err)
5353
cmdConn := c.(*commandConn)
5454
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))
@@ -145,7 +145,7 @@ func (mockStdoutEOF) Close() error {
145145

146146
func TestCloseWhileWriting(t *testing.T) {
147147
ctx := context.TODO()
148-
c, err := New(ctx, "sh", "-c", "while true; sleep 1; done")
148+
c, err := New(ctx, "sh", "-c", "while true; do sleep 1; done")
149149
assert.NilError(t, err)
150150
cmdConn := c.(*commandConn)
151151
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))
@@ -173,7 +173,7 @@ func TestCloseWhileWriting(t *testing.T) {
173173

174174
func TestCloseWhileReading(t *testing.T) {
175175
ctx := context.TODO()
176-
c, err := New(ctx, "sh", "-c", "while true; sleep 1; done")
176+
c, err := New(ctx, "sh", "-c", "while true; do sleep 1; done")
177177
assert.NilError(t, err)
178178
cmdConn := c.(*commandConn)
179179
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))

0 commit comments

Comments
 (0)