Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry network removal when cleaning up before and after test runs. #4214

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions bin/run-tests-on-swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,16 @@ docker_cleanup() {
fi

if docker network inspect $NETWORK &> /dev/null; then
if ! docker network rm $NETWORK &> /dev/null; then
log_debug "Could not remove network $NETWORK"
else
retries=5
while test $retries -gt 0; do
if docker network rm $NETWORK &> /dev/null; then
break
fi
retries=$(($retries - 1))
log_debug "Could not remove network $NETWORK ($retries retries left)"
sleep 2
done
if test $retries -gt 0; then
while [[ -n $(docker network ls | grep "$NETWORK.*swarm") ]]; do
log_debug "Waiting for network $NETWORK to be removed."
sleep 2
Expand Down