Bug 17678 - run-webkit-tests should have a watchdog timer (and timeout long tests)
Summary: run-webkit-tests should have a watchdog timer (and timeout long tests)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Adam Roben (:aroben)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-05 01:22 PST by Eric Seidel (no email)
Modified: 2008-04-17 17:01 PDT (History)
3 users (show)

See Also:


Attachments
Cleanup 1 (2.85 KB, patch)
2008-04-17 16:22 PDT, Adam Roben (:aroben)
eric: review+
Details | Formatted Diff | Diff
Cleanup 2 (3.69 KB, patch)
2008-04-17 16:23 PDT, Adam Roben (:aroben)
eric: review+
Details | Formatted Diff | Diff
Cleanup 3 (2.85 KB, patch)
2008-04-17 16:23 PDT, Adam Roben (:aroben)
eric: review+
Details | Formatted Diff | Diff
Cleanup 4 (8.63 KB, patch)
2008-04-17 16:23 PDT, Adam Roben (:aroben)
eric: review+
Details | Formatted Diff | Diff
Cleanup 5 (1.55 KB, patch)
2008-04-17 16:23 PDT, Adam Roben (:aroben)
eric: review+
Details | Formatted Diff | Diff
Fix v1 (9.32 KB, patch)
2008-04-17 16:24 PDT, Adam Roben (:aroben)
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2008-03-05 01:22:59 PST
run-webkit-tests should have a watchdog timer (and timeout long tests)

I've occasionally hit problems where I've made tests time-out.  It seems run-webkit-tests should just have a watchdog and automagically timeout tests which take to long.  Similar to the existing "wait until done" watchdog.  We could start with a very high value and lower it over time.
Comment 1 Stephanie Lewis 2008-03-05 11:35:26 PST
Something similar to the following could work

     my $actual = "";
-    while (<IN>) {
-        last if /#EOF/;
-        $actual .= $_;
+    eval {
+        local $SIG{ALRM} = sub { die "test timed out" }
+        alarm 60; # die if test takes more than a minute
+        eval { 
+            while (<IN>) {
+                last if /#EOF/;
+                $actual .= $_;
+            }
+        }
+        alarm 0; # cancel alarm
+    } 
+    alarm 0; # avoid race condition
+    my $alarm_error = $@;
+    die $alarm_error if $alarm_error && $alarm_error !~ /test timed out/; # reraise other errors
+    if ($alarm_error) {
+        printFailureMessageForTest($test, "Test timed out!");
+        killDumpTool();
+        next;
     }
Comment 2 mitz 2008-03-06 11:42:00 PST
DumpRenderTree support added by Brady in <http://trac.webkit.org/projects/webkit/changeset/30849>.
Comment 3 Brady Eidson 2008-03-06 11:45:52 PST
Indeed - DRT now has a Watchdog *thread* which is immune to deadlocks or "the timer thread going out to lunch"

It's turned on for DRTMac right now, and should be easy to turn on for other platforms DRT's as well.
Comment 4 Adam Roben (:aroben) 2008-04-17 15:10:58 PDT
I'm working on a fix for this.
Comment 5 Adam Roben (:aroben) 2008-04-17 16:22:54 PDT
Created attachment 20647 [details]
Cleanup 1
Comment 6 Adam Roben (:aroben) 2008-04-17 16:23:05 PDT
Created attachment 20648 [details]
Cleanup 2
Comment 7 Adam Roben (:aroben) 2008-04-17 16:23:15 PDT
Created attachment 20649 [details]
Cleanup 3
Comment 8 Adam Roben (:aroben) 2008-04-17 16:23:35 PDT
Created attachment 20651 [details]
Cleanup 4
Comment 9 Adam Roben (:aroben) 2008-04-17 16:23:47 PDT
Created attachment 20652 [details]
Cleanup 5
Comment 10 Adam Roben (:aroben) 2008-04-17 16:24:13 PDT
Created attachment 20653 [details]
Fix v1
Comment 11 Eric Seidel (no email) 2008-04-17 16:30:42 PDT
Comment on attachment 20653 [details]
Fix v1

Now we just need to lower the threshold in DRT until we have all tests passing in under 5 seconds. :)
Comment 12 Adam Roben (:aroben) 2008-04-17 17:01:04 PDT
Fixed in r32029