diff --git a/components/engine/integration-cli/docker_api_swarm_test.go b/components/engine/integration-cli/docker_api_swarm_test.go index c48e669c0d..83cf25e08b 100644 --- a/components/engine/integration-cli/docker_api_swarm_test.go +++ b/components/engine/integration-cli/docker_api_swarm_test.go @@ -340,6 +340,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) { } // wait for an election to occur + c.Logf("Waiting for election to occur...") waitAndAssert(c, defaultReconciliationTimeout, checkLeader(d2, d3), checker.True) // assert that we have a new leader @@ -351,9 +352,8 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) { // add the d1, the initial leader, back d1.Start(c) - // TODO(stevvooe): may need to wait for rejoin here - // wait for possible election + c.Logf("Waiting for possible election...") waitAndAssert(c, defaultReconciliationTimeout, checkLeader(d1, d2, d3), checker.True) // pick out the leader and the followers again diff --git a/components/engine/integration-cli/docker_utils_test.go b/components/engine/integration-cli/docker_utils_test.go index 732b2ac87c..8052c7951f 100644 --- a/components/engine/integration-cli/docker_utils_test.go +++ b/components/engine/integration-cli/docker_utils_test.go @@ -413,6 +413,12 @@ func getErrorMessage(c *check.C, body []byte) string { } func waitAndAssert(c *check.C, timeout time.Duration, f checkF, checker check.Checker, args ...interface{}) { + t1 := time.Now() + defer func() { + t2 := time.Now() + c.Logf("waited for %v (out of %v)", t2.Sub(t1), timeout) + }() + after := time.After(timeout) for { v, comment := f(c) diff --git a/components/engine/internal/test/daemon/node.go b/components/engine/internal/test/daemon/node.go index d9263a7f29..33dd365429 100644 --- a/components/engine/internal/test/daemon/node.go +++ b/components/engine/internal/test/daemon/node.go @@ -23,7 +23,7 @@ func (d *Daemon) GetNode(t assert.TestingT, id string) *swarm.Node { defer cli.Close() node, _, err := cli.NodeInspectWithRaw(context.Background(), id) - assert.NilError(t, err) + assert.NilError(t, err, "[%s] (*Daemon).GetNode: NodeInspectWithRaw(%q) failed", d.id, id) assert.Check(t, node.ID == id) return &node }