Changeset 86213 in webkit


Ignore:
Timestamp:
May 10, 2011 10:32:00 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-05-10 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

EWS bots should be robust against test-webkitpy hangs
https://bugs.webkit.org/show_bug.cgi?id=60579

Added a killAfterTimeout subroutine, which takes a child_pid
and timeout, and will setup a watchdog process to kill that child
after the timeout. killAfterTimeout will waitpid on the child.

  • EWSTools/start-queue.sh:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r86210 r86213  
     12011-05-10  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        EWS bots should be robust against test-webkitpy hangs
     6        https://bugs.webkit.org/show_bug.cgi?id=60579
     7
     8        Added a killAfterTimeout subroutine, which takes a child_pid
     9        and timeout, and will setup a watchdog process to kill that child
     10        after the timeout.  killAfterTimeout will waitpid on the child.
     11
     12        * EWSTools/start-queue.sh:
     13
    1142011-05-10  MORITA Hajime  <morrita@google.com>
    215
  • trunk/Tools/EWSTools/start-queue.sh

    r74301 r86213  
    11#!/bin/sh
    2 # Copyright (c) 2010 Google Inc. All rights reserved.
     2# Copyright (c) 2010, 2011 Google Inc. All rights reserved.
    33#
    44# Redistribution and use in source and binary forms, with or without
     
    2828# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929
     30killAfterTimeout() {
     31    TARGET_PID=$1
     32    TIMEOUT=$2
     33    sleep $TIMEOUT && kill -9 $TARGET_PID &
     34    WATCHDOG_PID=$!
     35    wait $TARGET_PID
     36    # FIXME: This kill will fail (and log) when the watchdog has exited (by killing the child process).
     37    # There is likely magic shell commands to make it not log (redirecting stderr/stdout didn't work).
     38    kill -9 $WATCHDOG_PID
     39}
     40
    3041if [[ $# -ne 2 ]];then
    3142echo "Usage: start-queue.sh QUEUE_NAME BOT_ID"
     
    4051fi
    4152
    42 cd /mnt/git/webkit-$1
     53QUEUE_NAME=$1
     54BOT_ID=$2
     55
     56cd /mnt/git/webkit-$QUEUE_NAME
    4357while :
    4458do
    45   git reset --hard trunk
    46   git clean -f
    47   git rebase --abort
     59  git reset --hard trunk # Throw away any patches in our tree.
     60  git clean --force # Remove any left-over layout test results, added files, etc.
     61  git rebase --abort # If we got killed during a git rebase, we need to clean up.
     62
     63  # Fetch before we rebase to speed up the rebase (fetching from git.webkit.org is way faster than pulling from svn.webkit.org)
    4864  git fetch
    4965  git svn rebase
     66
    5067  # test-webkitpy has code to remove orphaned .pyc files, so we
    5168  # run it before running webkit-patch to avoid stale .pyc files
    5269  # preventing webkit-patch from launching.
    53   ./Tools/Scripts/test-webkitpy
    54   ./Tools/Scripts/webkit-patch $1 --bot-id=$2 --no-confirm --exit-after-iteration 10
     70  ./Tools/Scripts/test-webkitpy &
     71  killAfterTimeout $! $[60*10] # Wait up to 10 minutes for it to run (should take < 30 seconds).
     72
     73  # We use --exit-after-iteration to pick up any changes to webkit-patch, including
     74  # changes to the committers.py file.
     75  # test-webkitpy has been known to hang in the past, so run it using killAfterTimeout
     76  # See https://bugs.webkit.org/show_bug.cgi?id=57724.
     77  ./Tools/Scripts/webkit-patch $QUEUE_NAME --bot-id=$BOT_ID --no-confirm --exit-after-iteration 10 &
     78  killAfterTimeout $! $[60*60*12] # Wait up to 12 hours.
    5579done
Note: See TracChangeset for help on using the changeset viewer.