From aeb83be5dfb50cc2ca3c2f42cb80a8031264a16c Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 7 May 2015 16:20:52 -0700 Subject: [PATCH] fix flacky rm test Signed-off-by: Victor Vieux --- test/integration/api/rm.bats | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test/integration/api/rm.bats b/test/integration/api/rm.bats index a347e3bf49..5b190ee9b3 100644 --- a/test/integration/api/rm.bats +++ b/test/integration/api/rm.bats @@ -11,17 +11,15 @@ function teardown() { start_docker_with_busybox 2 swarm_manage - run docker_swarm run -d --name test_container busybox - [ "$status" -eq 0 ] - + docker_swarm create --name test_container busybox + # make sure container exsists run docker_swarm ps -l [ "${#lines[@]}" -eq 2 ] [[ "${lines[1]}" == *"test_container"* ]] - run docker_swarm rm test_container - [ "$status" -eq 0 ] - + docker_swarm rm test_container + # verify run docker_swarm ps -aq [ "${#lines[@]}" -eq 0 ] @@ -31,8 +29,7 @@ function teardown() { start_docker_with_busybox 2 swarm_manage - run docker_swarm run -d --name test_container busybox sleep 500 - [ "$status" -eq 0 ] + docker_swarm run -d --name test_container busybox sleep 500 # make sure container exsists and is up run docker_swarm ps -a @@ -45,8 +42,7 @@ function teardown() { [ "$status" -ne 0 ] # rm -f, remove a running container - run docker_swarm rm -f test_container - [ "$status" -eq 0 ] + docker_swarm rm -f test_container # verify run docker_swarm ps -aq