From d2e375e31dd723a7ab3a442cb729e467fc21141e Mon Sep 17 00:00:00 2001 From: Morgan Bauer Date: Wed, 13 Apr 2016 10:24:47 +0100 Subject: [PATCH] volume rm integration test needs wait to avoid race - additional comments in test Signed-off-by: Morgan Bauer --- test/integration/api/volume.bats | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/integration/api/volume.bats b/test/integration/api/volume.bats index a33b33b71e..1b15174d85 100644 --- a/test/integration/api/volume.bats +++ b/test/integration/api/volume.bats @@ -73,20 +73,25 @@ function teardown() { start_docker_with_busybox 2 swarm_manage + # check for failure when removing a nonexistant volume run docker_swarm volume rm test_volume [ "$status" -ne 0 ] + # run a container that exits imediately but stays around and + # connected to the volume. Wait for it to finish. docker_swarm run -d --name=test_container -v=/tmp busybox true - + docker_swarm wait test_container + run docker_swarm volume ls -q volume=${output} [ "${#lines[@]}" -eq 1 ] + # check that removing an attached volume is an error run docker_swarm volume rm $volume [ "$status" -ne 0 ] docker_swarm rm test_container - + run docker_swarm volume rm $volume [ "$status" -eq 0 ] [ "${#lines[@]}" -eq 1 ]