Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 31c0ee5

Browse files
dpernythaJeztah
authored andcommitted
Fix TestSwarmClusterRotateUnlockKey
TestSwarmClusterRotateUnlockKey had been identified as a flaky test. It turns out that the test code was wrong: where we should have been checking the string output of a command, we were instead checking the value of the error. This means that the error case we were expecting was not being matched, and the test was failing when it should have just retried. Signed-off-by: Drew Erny <drew.erny@docker.com> (cherry picked from commit b79adac339173bf8bb6de6d0a061a97973c4b62b) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: c93da8ded9ac4efac6ac23af2ac32ab1ac50bb9b Component: engine
1 parent d5fe0c7 commit 31c0ee5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

components/engine/integration-cli/docker_cli_swarm_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ func (s *DockerSwarmSuite) TestSwarmRotateUnlockKey(c *check.C) {
13081308
// an issue sometimes prevents leader to be available right away
13091309
outs, err = d.Cmd("node", "ls")
13101310
if err != nil && retry < 5 {
1311-
if strings.Contains(err.Error(), "swarm does not have a leader") {
1311+
if strings.Contains(outs, "swarm does not have a leader") {
13121312
retry++
13131313
time.Sleep(3 * time.Second)
13141314
continue
@@ -1400,7 +1400,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterRotateUnlockKey(c *check.C) {
14001400
// an issue sometimes prevents leader to be available right away
14011401
outs, err = d.Cmd("node", "ls")
14021402
if err != nil && retry < 5 {
1403-
if strings.Contains(err.Error(), "swarm does not have a leader") {
1403+
if strings.Contains(outs, "swarm does not have a leader") {
14041404
retry++
14051405
time.Sleep(3 * time.Second)
14061406
continue

0 commit comments

Comments
 (0)