Test wrapper for jenkins
xvfb occasionally fails to start, causing xvfb-run to return 1. If that happens rerun it up to 9 times.
This commit is contained in:
parent
12d856b287
commit
fa39a1cb20
1 changed files with 24 additions and 0 deletions
24
jenkins-wrap.sh
Normal file
24
jenkins-wrap.sh
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
COUNTER=9
|
||||
|
||||
export PATH="/usr/local/bin:$PATH"
|
||||
|
||||
run_test() {
|
||||
xvfb-run -e xvfb-err "$@"
|
||||
}
|
||||
|
||||
run_test "$@"
|
||||
ERRORCODE=$?
|
||||
while [ $COUNTER -gt 0 -a $ERRORCODE -eq 1 ];do
|
||||
if [ -s xvfb-err ]; then
|
||||
echo "xvfb output:"
|
||||
cat xvfb-err
|
||||
rm xvfb-err
|
||||
fi
|
||||
echo "\n\'xvfb-run $@' returned 1, which could mean that xvfb failed. Retrying..."
|
||||
run_test "$@"
|
||||
ERRORCODE=$?
|
||||
COUNTER=$(($COUNTER - 1))
|
||||
done
|
||||
|
||||
rm -f xvfb-err
|
Loading…
Add table
Reference in a new issue