Do not wait for too long in do_run_test

This commit is contained in:
ZyX 2015-01-31 20:25:40 +03:00
parent 2ef5107628
commit f9d65fb34d
1 changed files with 7 additions and 1 deletions

View File

@ -111,8 +111,14 @@ do_run_test() {
done
# Wait for screen to initialize
sleep 1
while ! screen -S "$SESNAME" -p 0 -X width 300 1 ; do
local attempts=100
while ! screen -S "$SESNAME" -p 0 -X width 300 1 >/dev/null ; do
sleep 0.1s
attempts=$(( attempts - 1 ))
if test $attempts -eq 0 ; then
echo "Waiting for too long: assuming test failed"
return 1
fi
done
if ( \
test "x${SH}" = "xdash" \