From b179a3fc0d4828ad63f4ad80a4c75abe7081742c Mon Sep 17 00:00:00 2001 From: Dennis Chen Date: Thu, 17 May 2018 15:42:42 +0800 Subject: [PATCH] Some slight tweaks for the integration test `arm64` needs get more time duration for the test to finish. `pty.Start()` opens a file, so the caller should close it explicitly, else the file I/O can result in unexpected data synchronization issue. All those changes will not affect the test itself. Signed-off-by: Dennis Chen Upstream-commit: 476d7872efb60b1ef1bc7d9d83952f9dbc8f8798 Component: engine --- components/engine/hack/make.sh | 2 +- .../engine/integration-cli/docker_cli_exec_unix_test.go | 9 +++++---- components/engine/integration/internal/swarm/service.go | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/engine/hack/make.sh b/components/engine/hack/make.sh index be90bc019a..cd9232a4a5 100755 --- a/components/engine/hack/make.sh +++ b/components/engine/hack/make.sh @@ -159,7 +159,7 @@ ORIG_BUILDFLAGS+=( $REBUILD_FLAG ) BUILDFLAGS=( $BUILDFLAGS "${ORIG_BUILDFLAGS[@]}" ) # Test timeout. -if [ "${DOCKER_ENGINE_GOARCH}" == "arm" ]; then +if [ "${DOCKER_ENGINE_GOARCH}" == "arm64" ] || [ "${DOCKER_ENGINE_GOARCH}" == "arm" ]; then : ${TIMEOUT:=10m} elif [ "${DOCKER_ENGINE_GOARCH}" == "windows" ]; then : ${TIMEOUT:=8m} diff --git a/components/engine/integration-cli/docker_cli_exec_unix_test.go b/components/engine/integration-cli/docker_cli_exec_unix_test.go index 6608a7b704..337a90b116 100644 --- a/components/engine/integration-cli/docker_cli_exec_unix_test.go +++ b/components/engine/integration-cli/docker_cli_exec_unix_test.go @@ -25,7 +25,10 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) { c.Assert(err, checker.IsNil) b := bytes.NewBuffer(nil) - go io.Copy(b, p) + go func() { + io.Copy(b, p) + p.Close() + }() ch := make(chan error) go func() { ch <- cmd.Wait() }() @@ -33,9 +36,7 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) { select { case err := <-ch: c.Assert(err, checker.IsNil) - bs := b.Bytes() - bs = bytes.Trim(bs, "\x00") - output := string(bs[:]) + output := b.String() c.Assert(strings.TrimSpace(output), checker.Equals, "hello") case <-time.After(5 * time.Second): c.Fatal("timed out running docker exec") diff --git a/components/engine/integration/internal/swarm/service.go b/components/engine/integration/internal/swarm/service.go index 9035feeaeb..e6a1bfcdd0 100644 --- a/components/engine/integration/internal/swarm/service.go +++ b/components/engine/integration/internal/swarm/service.go @@ -22,7 +22,7 @@ func ServicePoll(config *poll.Settings) { config.Timeout = 30 * time.Second config.Delay = 100 * time.Millisecond if runtime.GOARCH == "arm64" || runtime.GOARCH == "arm" { - config.Timeout = 1 * time.Minute + config.Timeout = 90 * time.Second } }