tests: avoid early shutdown of sandbox

Because sandbox is closed down when the main test
that created the sandbox returns it can't have subtests
that set themselves as parallel as they would continue
to run in a different lifecycle.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2024-05-31 17:38:32 -07:00
parent b1cb658a31
commit 9a30215886
No known key found for this signature in database
GPG Key ID: AFA9DE5F8AB7AF39
1 changed files with 5 additions and 8 deletions

View File

@ -113,13 +113,10 @@ func testDialStdio(t *testing.T, sb integration.Sandbox) {
require.Equal(t, "world", string(dt))
}
t.Run("conn=netpipe", func(t *testing.T) {
t.Parallel()
do(t, func(t *testing.T, cmd *exec.Cmd) net.Conn {
c1, c2 := net.Pipe()
cmd.Stdin = c1
cmd.Stdout = c1
return c2
})
do(t, func(t *testing.T, cmd *exec.Cmd) net.Conn {
c1, c2 := net.Pipe()
cmd.Stdin = c1
cmd.Stdout = c1
return c2
})
}