Fix the occasional mp unit tests travis failure.
Probably could be written more succinctly, but should work.
This commit is contained in:
parent
f2324a2bf5
commit
5185071e96
1 changed files with 27 additions and 5 deletions
|
@ -6,18 +6,31 @@ set -v #Print shell commands as they are read
|
|||
TIMEOUT_TIME=300
|
||||
LOOP_TIME=6
|
||||
|
||||
./wesnothd --port 12345 --log-debug=server --log-warning=config &
|
||||
./wesnothd --port 12345 --log-debug=server --log-warning=config &> wesnothd.log &
|
||||
serverpid=$!
|
||||
|
||||
sleep 5
|
||||
|
||||
./wesnoth --plugin=host.lua --server=localhost:12345 --username=host --mp-test --noaddons --nogui &
|
||||
./wesnoth --plugin=host.lua --server=localhost:12345 --username=host --mp-test --noaddons --nogui &> wesnoth-host.log &
|
||||
hostpid=$!
|
||||
sleep 2
|
||||
|
||||
sleep 5
|
||||
while grep -q 'Could not initialize SDL_video' wesnoth-host.log; do
|
||||
echo "Could not initialize SDL_video error, retrying..."
|
||||
./wesnoth --plugin=host.lua --server=localhost:12345 --username=host --mp-test --noaddons --nogui &> wesnoth-host.log &
|
||||
hostpid=$!
|
||||
sleep 2
|
||||
done
|
||||
|
||||
./wesnoth --plugin=join.lua --server=localhost:12345 --username=join --mp-test --noaddons --nogui &
|
||||
./wesnoth --plugin=join.lua --server=localhost:12345 --username=join --mp-test --noaddons --nogui &> wesnoth-join.log &
|
||||
joinpid=$!
|
||||
sleep 2
|
||||
|
||||
while grep -q 'Could not initialize SDL_video' wesnoth-join.log; do
|
||||
echo "Could not initialize SDL_video error, retrying..."
|
||||
./wesnoth --plugin=join.lua --server=localhost:12345 --username=join --mp-test --noaddons --nogui &> wesnoth-join.log &
|
||||
joinpid=$!
|
||||
sleep 2
|
||||
done
|
||||
|
||||
START_TIME=$SECONDS
|
||||
HOST_RUNNING=yes
|
||||
|
@ -65,4 +78,13 @@ wait $joinpid || STATUS=1
|
|||
|
||||
kill $serverpid
|
||||
|
||||
echo "Server log:"
|
||||
cat wesnothd.log
|
||||
|
||||
echo "Host log:"
|
||||
cat wesnoth-host.log
|
||||
|
||||
echo "Join log:"
|
||||
cat wesnoth-join.log
|
||||
|
||||
exit $STATUS
|
||||
|
|
Loading…
Add table
Reference in a new issue