Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Vieux <vieux@docker.com>
  • Loading branch information
vieux authored and abronan committed Dec 8, 2015
1 parent a17f182 commit f1b7b7b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/integration/discovery/consul.bats
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function teardown() {
swarm_join "$DISCOVERY"

# Start a manager. It should keep retrying
swarm_manage "$DISCOVERY"
swarm_manage_no_wait "$DISCOVERY"

# Now start the store
start_store
Expand Down
2 changes: 1 addition & 1 deletion test/integration/discovery/etcd.bats
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function teardown() {
swarm_join "$DISCOVERY"

# Start a manager. It should keep retrying
swarm_manage "$DISCOVERY"
swarm_manage_no_wait "$DISCOVERY"

# Now start the store
start_store
Expand Down
2 changes: 1 addition & 1 deletion test/integration/discovery/file.bats
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function setup_discovery_file() {
start_docker 2

# Start a manager. It should keep retrying
swarm_manage "$DISCOVERY"
swarm_manage_no_wait "$DISCOVERY"

# Now create the discovery file.
setup_discovery_file
Expand Down
2 changes: 1 addition & 1 deletion test/integration/discovery/zk.bats
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function teardown() {
swarm_join "$DISCOVERY"

# Start a manager. It should keep retrying
swarm_manage "$DISCOVERY"
swarm_manage_no_wait "$DISCOVERY"

# Now start the store
start_store
Expand Down
14 changes: 10 additions & 4 deletions test/integration/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,17 @@ function discovery_check_swarm_info() {
retry 10 1 eval "docker -H $host info | grep -q -e \"Nodes: $total\" -e \"Offers: $total\""
}

# Start the swarm manager in background.
function swarm_manage() {
local i=${#SWARM_MANAGE_PID[@]}

swarm_manage_no_wait "$@"

# Wait for nodes to be discovered
discovery_check_swarm_info "${#HOSTS[@]}" "${SWARM_HOSTS[$i]}"
}

# Start the swarm manager in background.
function swarm_manage_no_wait() {
local discovery
if [ $# -eq 0 ]; then
discovery=`join , ${HOSTS[@]}`
Expand All @@ -114,9 +123,6 @@ function swarm_manage() {

# Wait for the Manager to be reachable
wait_until_reachable "$host"

# Wait for nodes to be discovered
discovery_check_swarm_info "${#HOSTS[@]}" "$host"
}

# swarm join every engine created with `start_docker`.
Expand Down

0 comments on commit f1b7b7b

Please sign in to comment.