From bd3c5c3636c256f7290d3284498f3a7736eae732 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 5 May 2015 18:35:09 -0700 Subject: [PATCH] Revert "use retry to wait for swarm join" This reverts commit 89fe217e12c4f1c2879d274ee4ba7ad324c38371. Signed-off-by: Andrea Luzzardi Conflicts: test/integration/helpers.bash --- test/integration/helpers.bash | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/integration/helpers.bash b/test/integration/helpers.bash index 14197c291b..d8fb4d1ba7 100644 --- a/test/integration/helpers.bash +++ b/test/integration/helpers.bash @@ -100,7 +100,24 @@ function swarm_join() { SWARM_JOIN_PID[$i]=$! ((++i)) done - retry 30 1 [ -n "$(docker_swarm info | grep -q 'Nodes: $i')" ] + wait_until_swarm_joined $i +} + +# Wait until a swarm instance joins the cluster. +# Parameter $1 is number of nodes to check. +function wait_until_swarm_joined { + local attempts=0 + local max_attempts=10 + + until [ $attempts -ge $max_attempts ]; do + run docker -H $SWARM_HOST info + if [[ "${lines[3]}" == *"Nodes: $1"* ]]; then + break + fi + echo "Checking if joined successfully for the $((++attempts)) time" >&2 + sleep 1 + done + [[ $attempts -lt $max_attempts ]] } # Stops the manager.