Merge pull request #5291 from laurazard/fix-all-the-flaky-connhelper-tests

tests: fix other flaky `connhelper` tests
This commit is contained in:
Laura Brehm 2024-07-24 12:03:55 +01:00 committed by GitHub
commit 1e0f669b00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -145,7 +145,7 @@ func (mockStdoutEOF) Close() error {
func TestCloseWhileWriting(t *testing.T) { func TestCloseWhileWriting(t *testing.T) {
ctx := context.TODO() ctx := context.TODO()
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))
@ -173,7 +173,7 @@ func TestCloseWhileWriting(t *testing.T) {
func TestCloseWhileReading(t *testing.T) { func TestCloseWhileReading(t *testing.T) {
ctx := context.TODO() ctx := context.TODO()
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))