Merge pull request #1793 from vieux/flacky_before_test

fix flacky before tests
This commit is contained in:
Dongluo Chen 2016-02-10 17:27:58 -08:00
commit 7952727bb7
1 changed files with 5 additions and 6 deletions

View File

@ -73,18 +73,17 @@ function teardown() {
start_docker_with_busybox 2
swarm_manage
docker_swarm run -d --name c1 busybox echo c1
docker_swarm run -d --name container1 busybox echo container1
sleep 1 #sleep so the 2 containers don't start at the same second
docker_swarm run -d --name c2 busybox echo c2
docker_swarm run -d --name container2 busybox echo container2
run eval "docker_swarm ps --before c1 2>/dev/null"
echo $output
run eval "docker_swarm ps --before container1 2>/dev/null"
[ "${#lines[@]}" -eq 1 ]
run eval "docker_swarm ps --before c2 2>/dev/null"
run eval "docker_swarm ps --before container2 2>/dev/null"
[ "${#lines[@]}" -eq 2 ]
run docker_swarm ps --before c3
run docker_swarm ps --before container3
[ "$status" -eq 1 ]
}