Skip to content

Commit

Permalink
travis timeout workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaise Tine committed Nov 23, 2020
1 parent 23cf72d commit e281d32
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 44 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ script:
- travis_wait 45 ci/test_driver.sh
- travis_wait 45 ci/test_riscv_isa.sh
- travis_wait 45 ci/test_opencl.sh
- travis_wait 45 ci/blackbox.sh --travis --driver=rtlsim
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=1 --scope --app=demo --args="-n1"
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --debug
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=1
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=2
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=4
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=2 --l2cache
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=4 --l2cache
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=2 --l2cache --clusters=2
- travis_wait 45 ci/blackbox.sh --travis --driver=vlsim --cores=2 --l2cache --clusters=4
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=rtlsim
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=1 --scope --app=demo --args="-n1"
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --debug
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=1
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=2
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=4
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=2 --l2cache
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=4 --l2cache
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=2 --l2cache --clusters=2
- travis_wait 45 ./ci/travis_run.py ./ci/blackbox.sh --driver=vlsim --cores=2 --l2cache --clusters=4

after_success:
# Gather code coverage
Expand Down
39 changes: 6 additions & 33 deletions ci/blackbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
show_usage()
{
echo "Vortex BlackBox Test Driver v1.0"
echo "Usage: [[--clusters=#n] [--cores=#n] [--warps=#n] [--threads=#n] [--l2cache] [[--driver=rtlsim|vlsim] [--debug] [--scope] [--travis] [--app=vecadd|sgemm|basic|demo|dogfood] [--args=<args>] [--help]]"
echo "Usage: [[--clusters=#n] [--cores=#n] [--warps=#n] [--threads=#n] [--l2cache] [[--driver=rtlsim|vlsim] [--debug] [--scope] [--app=vecadd|sgemm|basic|demo|dogfood] [--args=<args>] [--help]]"
}

DRIVER=vlsim
Expand All @@ -18,7 +18,6 @@ THREADS=4
L2=0
DEBUG=0
SCOPE=0
TRAVIS=0
HAS_ARGS=0

for i in "$@"
Expand Down Expand Up @@ -65,17 +64,13 @@ case $i in
HAS_ARGS=1
shift
;;
--travis)
TRAVIS=1
shift
;;
--help)
show_usage
exit
exit 0
;;
*)
show_usage
exit
exit -1
;;
esac
done
Expand All @@ -91,7 +86,7 @@ case $DRIVER in
;;
*)
echo "invalid driver: $DRIVER"
exit
exit -1
;;
esac

Expand All @@ -113,7 +108,7 @@ case $APP in
;;
*)
echo "invalid app: $APP"
exit
exit -1
;;
esac

Expand All @@ -124,13 +119,7 @@ echo "CONFIGS=$CONFIGS"
make -C $DRIVER_PATH clean

if [ $DEBUG -eq 1 ]
then
if [ $TRAVIS -eq 1 ]
then
while sleep 5m; do echo "*** still running..."; done &
sleep_pid=$!
fi

then
if [ $SCOPE -eq 1 ]
then
DEBUG=1 SCOPE=1 CONFIGS="$CONFIGS" make -C $DRIVER_PATH $DRIVER_EXTRA > build.log 2>&1
Expand All @@ -144,29 +133,13 @@ then
else
make -C $APP_PATH run-$DRIVER > run.log 2>&1
fi

if [ $TRAVIS -eq 1 ]
then
kill $sleep_pid
fi
else
if [ $TRAVIS -eq 1 ]
then
while sleep 5m; do echo "*** still running..."; done &
sleep_pid=$!
fi

if [ $SCOPE -eq 1 ]
then
SCOPE=1 CONFIGS="$CONFIGS" make -C $DRIVER_PATH $DRIVER_EXTRA > build.log 2>&1
else
CONFIGS="$CONFIGS" make -C $DRIVER_PATH $DRIVER_EXTRA > build.log 2>&1
fi

if [ $TRAVIS -eq 1 ]
then
kill $sleep_pid
fi

if [ $HAS_ARGS -eq 1 ]
then
Expand Down
44 changes: 44 additions & 0 deletions ci/travis_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python
import sys
import time
import threading
import subprocess

PingInterval = 15

def PingCallback(stop):
wait_time = 0
while True:
time.sleep(PingInterval)
wait_time += PingInterval
print(" + still running (" + str(wait_time) + "s) ...")
sys.stdout.flush()
if stop():
break

def run_command(command):
process = subprocess.Popen(command, stdout=subprocess.PIPE)
while True:
output = process.stdout.readline()
if output == '' and process.poll() is not None:
break
if output:
print output.strip()
return process.returncode

def main(argv):

stop_threads = False
t = threading.Thread(target = PingCallback, args =(lambda : stop_threads, ))
t.start()

exitcode = run_command(argv)
print(" + exitcode="+str(exitcode))

stop_threads = True
t.join()

sys.exit(exitcode)

if __name__ == "__main__":
main(sys.argv[1:])

0 comments on commit e281d32

Please sign in to comment.