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>
| ... | ... |
@@ -33,7 +33,9 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {
|
| 33 | 33 |
select {
|
| 34 | 34 |
case err := <-ch: |
| 35 | 35 |
c.Assert(err, checker.IsNil) |
| 36 |
- output := b.String() |
|
| 36 |
+ bs := b.Bytes() |
|
| 37 |
+ bs = bytes.Trim(bs, "\x00") |
|
| 38 |
+ output := string(bs[:]) |
|
| 37 | 39 |
c.Assert(strings.TrimSpace(output), checker.Equals, "hello") |
| 38 | 40 |
case <-time.After(5 * time.Second): |
| 39 | 41 |
c.Fatal("timed out running docker exec")
|