Skip to content

Commit

Permalink
Change *_RUNNING vars to string comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 authored and GregoryLundberg committed Nov 30, 2017
1 parent ec90985 commit 51fc433
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions utils/travis/mp_test_executor.sh
Expand Up @@ -18,8 +18,8 @@ hostpid=$!
joinpid=$!

START_TIME=$SECONDS
HOST_RUNNING=0
JOIN_RUNNING=0
HOST_RUNNING=yes
JOIN_RUNNING=yes
while true; do
# Timeout
EXEC_TIME=$(($SECONDS - $START_TIME))
Expand All @@ -30,10 +30,10 @@ while true; do
fi
# Check if clients still running
if ! kill -0 $hostpid 2>/dev/null; then
HOST_RUNNING=1
HOST_RUNNING=no
fi
if ! kill -0 $joinpid 2>/dev/null; then
JOIN_RUNNING=1
JOIN_RUNNING=no
fi

sleep $LOOP_TIME
Expand All @@ -43,12 +43,12 @@ while true; do
break
fi
# If one has finished previously, kill the other
if [ $HOST_RUNNING == 1 ]; then
if [ $HOST_RUNNING = "no" ]; then
echo "Host finished at least $LOOP_TIME seconds ago. Killing join"
kill $joinpid 2>/dev/null
break
fi
if [ $JOIN_RUNNING == 1 ]; then
if [ $JOIN_RUNNING = "no" ]; then
echo "Join finished at least $LOOP_TIME seconds ago. Killing host"
kill $hostpid 2>/dev/null
break
Expand Down

0 comments on commit 51fc433

Please sign in to comment.