Skip to content

Commit

Permalink
Fix flaky TestSwarmNodeTaskListFilter by waiting for task fully deployed
Browse files Browse the repository at this point in the history
This is an attempt to fix the flaky test of TestSwarmNodeTaskListFilter in 25029.

Basically this fix adds a check to wait until 3 containers has already up,
before processing `node tasks ...`.

This might fix 25029.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
  • Loading branch information
yongtang committed Jul 26, 2016
1 parent 4e3d6e3 commit 63c0366
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions integration-cli/docker_cli_swarm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ func (s *DockerSwarmSuite) TestSwarmNodeTaskListFilter(c *check.C) {
c.Assert(err, checker.IsNil)
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "")

// make sure task has been deployed.
waitAndAssert(c, defaultReconciliationTimeout, d.checkActiveContainerCount, checker.Equals, 3)

filter := "name=redis-cluster"

out, err = d.Cmd("node", "tasks", "--filter", filter, "self")
Expand Down

0 comments on commit 63c0366

Please sign in to comment.