瀏覽代碼

Merge pull request #39616 from dperny/fix-cluster-rotate-unlock-key

Fix TestSwarmClusterRotateUnlockKey
Tibor Vass 6 年之前
父節點
當前提交
917a8b4259
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      integration-cli/docker_cli_swarm_test.go

+ 2 - 2
integration-cli/docker_cli_swarm_test.go

@@ -1312,7 +1312,7 @@ func (s *DockerSwarmSuite) TestSwarmRotateUnlockKey(c *check.C) {
 			// an issue sometimes prevents leader to be available right away
 			outs, err = d.Cmd("node", "ls")
 			if err != nil && retry < 5 {
-				if strings.Contains(err.Error(), "swarm does not have a leader") {
+				if strings.Contains(outs, "swarm does not have a leader") {
 					retry++
 					time.Sleep(3 * time.Second)
 					continue
@@ -1404,7 +1404,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterRotateUnlockKey(c *check.C) {
 				// an issue sometimes prevents leader to be available right away
 				outs, err = d.Cmd("node", "ls")
 				if err != nil && retry < 5 {
-					if strings.Contains(err.Error(), "swarm does not have a leader") {
+					if strings.Contains(outs, "swarm does not have a leader") {
 						retry++
 						time.Sleep(3 * time.Second)
 						continue