Skip to content

Commit

Permalink
integration: restart docker daemon after each test (#2298)
Browse files Browse the repository at this point in the history
To be sure that containers from previous tests are not running in the
next test.
  • Loading branch information
alban authored and Alfonso Acosta committed Mar 4, 2017
1 parent 29b521b commit 32550f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion integration/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 32550f6

Please sign in to comment.