integration: restart docker daemon after each test (#2298)

To be sure that containers from previous tests are not running in the
next test.
This commit is contained in:
Alban Crequy
2017-03-04 00:47:40 -08:00
committed by Alfonso Acosta
parent 29b521b686
commit 32550f60f2

View File

@@ -31,7 +31,12 @@ weave_on() {
scope_end_suite() {
end_suite
for host in $HOSTS; do
docker_on "$host" rm -f "$(docker_on "$host" ps -a -q)" 2>/dev/null 1>&2 || true
docker_on "$host" rm -f "$(docker_on "$host" ps -a -q)" || true
# Unfortunately, "docker rm" might not work: the CircleCI's Docker
# client is unable to delete containers on GCE's Docker server. As a
# workaround, restart the Docker daemon: at least the containers from
# previous tests will not be running.
run_on "$host" "sudo service docker restart"
done
}