From eba485a3c6ac41bf844279c13a88844a512de4ac Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 9 Sep 2019 10:44:11 -0700 Subject: [PATCH] Fix Service TTY test so signal handlers work Noticed this test container not exiting correctly while debugging another issue. Before this change, signals were being eaten by bash, now they are hanlded by top. This cuts the test time in half since it doesn't have to wait for docker to SIGKILL it. Old: PASS: docker_cli_swarm_test.go:840: DockerSwarmSuite.TestSwarmServiceTTY 18.997s New: PASS: docker_cli_swarm_test.go:840: DockerSwarmSuite.TestSwarmServiceTTY 6.293s Signed-off-by: Brian Goff (cherry picked from commit e6c5563ae9d083cc72fcf84796c542047ac0a299) Signed-off-by: Sebastiaan van Stijn --- integration-cli/docker_cli_swarm_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-cli/docker_cli_swarm_test.go b/integration-cli/docker_cli_swarm_test.go index 0eca47cd09..9800b5fbd1 100644 --- a/integration-cli/docker_cli_swarm_test.go +++ b/integration-cli/docker_cli_swarm_test.go @@ -842,7 +842,7 @@ func (s *DockerSwarmSuite) TestSwarmServiceTTY(c *check.C) { name := "top" - ttyCheck := "if [ -t 0 ]; then echo TTY > /status && top; else echo none > /status && top; fi" + ttyCheck := "if [ -t 0 ]; then echo TTY > /status; else echo none > /status; fi; exec top" // Without --tty expectedOutput := "none"