integration-cli: TestSlowStdinClosing: add logs, and potential naming conflict
This test has become quite flaky on Windows / Windows with Containerd. Looking at the test, I noticed that it's running a test three times (according to the comment "as it failed ~ 50% of the time"). However; - it uses the `--rm` option to clean up the container after it terminated - it uses a fixed name for the containers that are started I had a quick look at the issue that it was created for, and neither of those options were mentioned in the reported bug (so are just part of the test setup). I think the test was written when the `--rm` option was still client-side, in which case the cli would not terminate until it removed the container (making the remove synchronous). Current versions of docker have moved the `--rm` to the daemon side, and (if I'm not mistaken) performed asynchronous, and therefore could potentially cause a conflicting name. This patch: - removes the fixed name (the test doesn't require the container to have a specific name, so we can just use a random name) - adds logs to capture the stderr and stdout output of the run (so that we're able to capture failure messages). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
54d35c071d
commit
496a4bd15e
1 changed files with 7 additions and 5 deletions
|
@ -4157,17 +4157,19 @@ func (s *DockerSuite) TestRunEmptyEnv(c *testing.T) {
|
|||
|
||||
// #28658
|
||||
func (s *DockerSuite) TestSlowStdinClosing(c *testing.T) {
|
||||
name := "testslowstdinclosing"
|
||||
repeat := 3 // regression happened 50% of the time
|
||||
const repeat = 3 // regression happened 50% of the time
|
||||
for i := 0; i < repeat; i++ {
|
||||
cmd := icmd.Cmd{
|
||||
Command: []string{dockerBinary, "run", "--rm", "--name", name, "-i", "busybox", "cat"},
|
||||
Command: []string{dockerBinary, "run", "--rm", "-i", "busybox", "cat"},
|
||||
Stdin: &delayedReader{},
|
||||
}
|
||||
done := make(chan error, 1)
|
||||
go func() {
|
||||
err := icmd.RunCmd(cmd).Error
|
||||
done <- err
|
||||
result := icmd.RunCmd(cmd)
|
||||
if out := result.Combined(); out != "" {
|
||||
c.Log(out)
|
||||
}
|
||||
done <- result.Error
|
||||
}()
|
||||
|
||||
select {
|
||||
|
|
Loading…
Reference in a new issue