mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1164618 - Start Xvfb in a loop in docker images; r=dustin
Sometimes the Xvfb sanity check can fail due to slow startup times, this introduces a simple retry system, with sleeps, to ensure that failures are due to another cause.
This commit is contained in:
parent
76d0709cbe
commit
362b14807e
@ -80,9 +80,21 @@ if $NEED_XVFB; then
|
||||
xvfb_pid=$!
|
||||
# Only error code 255 matters, because it signifies that no
|
||||
# display could be opened. As long as we can open the display
|
||||
# tests should work.
|
||||
sleep 2 # we need to sleep so that Xvfb has time to startup
|
||||
xvinfo || if [ $? == 255 ]; then exit 255; fi
|
||||
# tests should work. We'll retry a few times with a sleep before
|
||||
# failing.
|
||||
retry_count=0
|
||||
max_retries=2
|
||||
xvfb_test=0
|
||||
until [ $retry_count -gt $max_retries ]; do
|
||||
xvinfo || xvfb_test=$?
|
||||
if [ $xvfb_test != 255 ]; then
|
||||
retry_count=$(($max_retries + 1))
|
||||
else
|
||||
retry_count=$(($retry_count + 1))
|
||||
echo "Failed to start Xvfb, retry: $retry_count"
|
||||
sleep 2
|
||||
fi done
|
||||
if [ $xvfb_test == 255 ]; then exit 255; fi
|
||||
fi
|
||||
|
||||
# set up mozharness configuration, via command line, env, etc.
|
||||
|
Loading…
Reference in New Issue
Block a user