From 5cfe0cb2d306b54d636e8e159cbc502892079ba7 Mon Sep 17 00:00:00 2001 From: Nicolas Duchon Date: Sat, 28 Nov 2020 00:19:45 +0100 Subject: [PATCH] Fix the container_restart test This might be a race condition --- test/tests/container_restart/run.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/tests/container_restart/run.sh b/test/tests/container_restart/run.sh index 09511a8..8ef539d 100755 --- a/test/tests/container_restart/run.sh +++ b/test/tests/container_restart/run.sh @@ -36,7 +36,6 @@ function cleanup { trap cleanup EXIT # Run a separate nginx container for each domain in the $domains array. -# Start all the containers in a row so that docker-gen debounce timers fire only once. for domain in "${domains[@]}"; do if docker run --rm -d \ --name "$domain" \ @@ -50,21 +49,15 @@ for domain in "${domains[@]}"; do else echo "Could not start test web server for $domain" fi -done - -for domain in "${domains[@]}"; do # Check if container restarted timeout="$(date +%s)" - timeout="$((timeout + 120))" + timeout="$((timeout + 60))" until grep "$domain" "${TRAVIS_BUILD_DIR}"/test/tests/container_restart/docker_event_out.txt; do if [[ "$(date +%s)" -gt "$timeout" ]]; then - echo "Container $domain didn't restart in under two minute." + echo "Container $domain didn't restart in under one minute." break fi sleep 0.1 done - - # Stop the Nginx container silently. - docker stop "$domain" > /dev/null done