Bug 1135399 - Timeout shell builds. r=catlee, a=test-only
authorSteve Fink <sfink@mozilla.com>
Wed, 18 Mar 2015 10:59:17 -0700
changeset 260309 b6bf89c748b7
parent 260308 a5013ed3d1f0
child 260310 b8f7eabd31b9
push id743
push userryanvm@gmail.com
push date2015-04-28 15:04 +0000
treeherdermozilla-release@16c98999de0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatlee, test-only
bugs1135399
milestone38.0
Bug 1135399 - Timeout shell builds. r=catlee, a=test-only
js/src/devtools/automation/autospider.sh
--- a/js/src/devtools/automation/autospider.sh
+++ b/js/src/devtools/automation/autospider.sh
@@ -7,27 +7,33 @@ ABSDIR="$(cd $DIR; pwd)"
 SOURCE="$(cd $DIR/../../../..; pwd)"
 
 function usage() {
   echo "Usage: $0 [--dep] <variant>"
 }
 
 clean=""
 platform=""
+TIMEOUT=7200
 while [ $# -gt 1 ]; do
     case "$1" in
         --clobber)
             shift
             clean=1
             ;;
         --platform)
             shift
             platform="$1"
             shift
             ;;
+        --timeout)
+            shift
+            TIMEOUT="$1"
+            shift
+            ;;
         *)
             echo "Invalid arguments" >&2
             usage
             exit 1
             ;;
     esac
 done
 
@@ -125,16 +131,22 @@ COMMAND_PREFIX=''
 
 # On Linux, disable ASLR to make shell builds a bit more reproducible.
 if type setarch >/dev/null 2>&1; then
     COMMAND_PREFIX="setarch $(uname -m) -R "
 fi
 
 RUN_JSTESTS=true
 
+PARENT=$$
+sh -c "sleep $TIMEOUT; kill $PARENT" <&- >&- 2>&- &
+KILLER=$!
+disown %1
+trap "kill $KILLER" EXIT
+
 if [[ "$VARIANT" = "rootanalysis" ]]; then
     export JS_GC_ZEAL=7
 
 elif [[ "$VARIANT" = "compacting" ]]; then
     export JS_GC_ZEAL=14
 
     # Ignore timeouts from tests that are known to take too long with this zeal mode
     export JITTEST_EXTRA_ARGS=--ignore-timeouts=$ABSDIR/cgc-jittest-timeouts.txt