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>
| ... | ... |
@@ -177,6 +177,9 @@ func (s *DockerSwarmSuite) TestSwarmNodeTaskListFilter(c *check.C) {
|
| 177 | 177 |
c.Assert(err, checker.IsNil) |
| 178 | 178 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 179 | 179 |
|
| 180 |
+ // make sure task has been deployed. |
|
| 181 |
+ waitAndAssert(c, defaultReconciliationTimeout, d.checkActiveContainerCount, checker.Equals, 3) |
|
| 182 |
+ |
|
| 180 | 183 |
filter := "name=redis-cluster" |
| 181 | 184 |
|
| 182 | 185 |
out, err = d.Cmd("node", "tasks", "--filter", filter, "self")
|