forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Make travis logs not as long (ray-project#4213)
* clean it up * Update .travis.yml * Update .travis.yml * update * fix example * suppress * timeout * print periodic progress * Update suppress_output * Update run_silent.sh * Update suppress_output * Update suppress_output * manually do timeout * sleep 300 * fix test * Update run_silent.sh * Update suppress_output * Update .travis.yml
- Loading branch information
Showing
4 changed files
with
86 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# Run a command, suppressing output unless it hangs or crashes. | ||
|
||
TMPFILE=`mktemp` | ||
COMMAND="$@" | ||
PID=$$ | ||
|
||
# Print output to avoid travis killing us | ||
watchdog() { | ||
for i in `seq 5 5 120`; do | ||
sleep 300 | ||
echo "This command has been running for more than $i minutes..." | ||
done | ||
echo "Command timed out after 2h, dumping logs:" | ||
cat $TMPFILE | ||
echo "TIMED OUT" | ||
kill -SIGKILL $PID | ||
} | ||
|
||
watchdog & 2>/dev/null | ||
WATCHDOG_PID=$! | ||
|
||
time $COMMAND >$TMPFILE 2>&1 | ||
|
||
CODE=$? | ||
if [ $CODE != 0 ]; then | ||
cat $TMPFILE | ||
echo "FAILED $CODE" | ||
kill $WATCHDOG_PID | ||
exit $CODE | ||
fi | ||
|
||
kill $WATCHDOG_PID | ||
exit 0 |