فهرست منبع

Merge pull request #37076 from arm64b/TestExecInteractiveStdinClose

Fix flaky test case of `TestExecInteractiveStdinClose`
Vincent Demeester 7 سال پیش
والد
کامیت
b7b6b6929c
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      integration-cli/docker_cli_exec_unix_test.go

+ 3 - 1
integration-cli/docker_cli_exec_unix_test.go

@@ -33,7 +33,9 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {
 	select {
 	case err := <-ch:
 		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")
 	case <-time.After(5 * time.Second):
 		c.Fatal("timed out running docker exec")