Skip to content

Commit

Permalink
Test wrapper for jenkins
Browse files Browse the repository at this point in the history
xvfb occasionally fails to start, causing xvfb-run to return 1.
If that happens rerun it up to 9 times.
  • Loading branch information
AI0867 committed Jun 17, 2014
1 parent 12d856b commit fa39a1c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions jenkins-wrap.sh
@@ -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

0 comments on commit fa39a1c

Please sign in to comment.