mirror of
https://github.com/docker/docs.git
synced 2026-04-12 14:25:46 +07:00
Merge pull request #2116 from MHBauer/volume-rm-race
volume rm integration test needs wait to avoid race
This commit is contained in:
@@ -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 ]
|
||||
|
||||
Reference in New Issue
Block a user