From 0f217cead8260ab45f9749074d954e5e9e76187b Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Fri, 25 Mar 2016 14:42:30 -0700 Subject: [PATCH] integration-cli: exit early if daemon immedately crashed this reduces execution of TestInfoDiscoveryInvalidAdvertise from 11s to 0.2s Signed-off-by: Alexander Morozov --- integration-cli/daemon.go | 2 ++ integration-cli/docker_cli_daemon_test.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/integration-cli/daemon.go b/integration-cli/daemon.go index 7c2ab34be5..e30a68810a 100644 --- a/integration-cli/daemon.go +++ b/integration-cli/daemon.go @@ -233,6 +233,8 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error { return fmt.Errorf("[%s] error querying daemon for root directory: %v", d.id, err) } return nil + case <-d.wait: + return fmt.Errorf("[%s] Daemon exited during startup", d.id) } } } diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 200f37cb52..c19f1a763a 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -563,7 +563,7 @@ func (s *DockerDaemonSuite) TestDaemonExitOnFailure(c *check.C) { //attempt to start daemon with incorrect flags (we know -b and --bip conflict) if err := s.d.Start("--bridge", "nosuchbridge", "--bip", "1.1.1.1"); err != nil { //verify we got the right error - if !strings.Contains(err.Error(), "Daemon exited and never started") { + if !strings.Contains(err.Error(), "Daemon exited") { c.Fatalf("Expected daemon not to start, got %v", err) } // look in the log and make sure we got the message that daemon is shutting down