mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix flaky test case of TestExecInteractiveStdinClose
This issue has been reported by issue #36877. The purpose of this test case is for the regression test of #12546, so we only need to make sure the essential of the testing is still in the way to check that while not disturbed by some testing noises, which is exactly what this PR want to do. Signed-off-by: Dennis Chen <dennis.chen@arm.com>
This commit is contained in:
parent
85a8252c47
commit
96abf9f59e
1 changed files with 3 additions and 1 deletions
|
@ -33,7 +33,9 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {
|
||||||
select {
|
select {
|
||||||
case err := <-ch:
|
case err := <-ch:
|
||||||
c.Assert(err, checker.IsNil)
|
c.Assert(err, checker.IsNil)
|
||||||
output := b.String()
|
bs := b.Bytes()
|
||||||
|
bs = bytes.Trim(bs, "\x00")
|
||||||
|
output := string(bs[:])
|
||||||
c.Assert(strings.TrimSpace(output), checker.Equals, "hello")
|
c.Assert(strings.TrimSpace(output), checker.Equals, "hello")
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(5 * time.Second):
|
||||||
c.Fatal("timed out running docker exec")
|
c.Fatal("timed out running docker exec")
|
||||||
|
|
Loading…
Reference in a new issue