From a81aa78cebd0dbdd17ff039f7aa6be48e400906a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Wed, 17 Jun 2026 21:15:23 +0200 Subject: [PATCH] TestContainerWithConflictingNoneNetwork: Extend Windows timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increase stop timeout on Windows and split container and CLI exit waits. Wait for the container to reach `exited` before timing how long the `docker run -i` process takes to exit with stdin still open. This keeps the regression check focused on the post-exit CLI behavior instead of combining it with container startup time. Use a unique container name to avoid collisions with leftovers from previous runs. Signed-off-by: Paweł Gronowski --- integration-cli/docker_cli_run_test.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index 094f9b9391..1c3d50437c 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -3501,7 +3501,9 @@ func (s *DockerCLIRunSuite) TestContainerWithConflictingNoneNetwork(c *testing.T // #11957 - stdin with no tty does not exit if stdin is not closed even though container exited func (s *DockerCLIRunSuite) TestRunStdinBlockedAfterContainerExit(c *testing.T) { - cmd := exec.Command(dockerBinary, "run", "-i", "--name=test", "busybox", "true") + name := "test-stdin-blocked-" + stringid.GenerateRandomID() + + cmd := exec.Command(dockerBinary, "run", "-i", "--name", name, "busybox", "true") in, err := cmd.StdinPipe() assert.NilError(c, err) defer in.Close() @@ -3509,14 +3511,23 @@ func (s *DockerCLIRunSuite) TestRunStdinBlockedAfterContainerExit(c *testing.T) cmd.Stdout = stdout cmd.Stderr = stdout assert.NilError(c, cmd.Start()) + c.Cleanup(func() { + dockerCmdWithError("rm", "-f", name) + }) - waitChan := make(chan error, 1) + exitTimeout := 10 * time.Second + if DaemonIsWindows() { + exitTimeout = 60 * time.Second + } + cli.WaitExited(c, name, exitTimeout) + + cmdExited := make(chan error, 1) go func() { - waitChan <- cmd.Wait() + cmdExited <- cmd.Wait() }() select { - case err := <-waitChan: + case err := <-cmdExited: assert.Assert(c, err == nil, stdout.String()) case <-time.After(30 * time.Second): c.Fatal("timeout waiting for command to exit")