mirror of
https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion
synced 2024-06-25 15:47:14 +02:00
Fix the container_restart test
This might be a race condition
This commit is contained in:
parent
f069d50d33
commit
5cfe0cb2d3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue