Skip to content

Commit

Permalink
Wait for Xvfb to start in run-test
Browse files Browse the repository at this point in the history
  • Loading branch information
rmol committed Apr 3, 2019
1 parent 7960dbc commit fb014bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion securedrop/bin/dev-deps
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
export DISPLAY=:1

function run_xvfb() {
setsid Xvfb :1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset >& /tmp/xvfb.out || cat /tmp/xvfb.out
(setsid Xvfb :1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset >& /tmp/xvfb.out || cat /tmp/xvfb.out) &

# give it time to start
for i in {1..10}
do
xdpyinfo -display :1 >/dev/null 2>&1 && return 0
sleep 1
done
xdpyinfo -display :1 >/dev/null 2>&1 || (echo "Xvfb is not available"; exit 1)
}

function run_redis() {
Expand Down
4 changes: 2 additions & 2 deletions securedrop/bin/run-test
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/dev-deps"

setup_vncauth
run_xvfb
run_redis &
run_xvfb &
setup_vncauth
run_x11vnc &
urandom
run_sass --force --update
Expand Down

0 comments on commit fb014bd

Please sign in to comment.