Title: [119018] trunk/Tools
Revision
119018
Author
[email protected]
Date
2012-05-30 18:51:50 -0700 (Wed, 30 May 2012)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=87717
Unresponsive WebProcesses can be mistaken for WebProcess crashes.

Reviewed by Dirk Pranke.

Change the error message from #CRASHED to #UNRESPONSIVE PROCESS
If there isn't a crash log found for the process add a message saying
the process was unresponsive.

* Scripts/webkitpy/layout_tests/port/webkit.py:
(WebKitDriver.__init__):
(WebKitDriver._check_for_driver_crash):
(WebKitDriver.run_test):
* Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
(WebKitDriverTest.test_check_for_driver_crash.assert_crash):
(WebKitDriverTest):
(WebKitDriverTest.test_check_for_driver_crash):
* WebKitTestRunner/TestController.cpp:
(WTR):
(WTR::TestController::runTest):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (119017 => 119018)


--- trunk/Tools/ChangeLog	2012-05-31 01:51:26 UTC (rev 119017)
+++ trunk/Tools/ChangeLog	2012-05-31 01:51:50 UTC (rev 119018)
@@ -1,5 +1,28 @@
 2012-05-30  Stephanie Lewis  <[email protected]>
 
+        https://bugs.webkit.org/show_bug.cgi?id=87717
+        Unresponsive WebProcesses can be mistaken for WebProcess crashes.
+
+        Reviewed by Dirk Pranke.
+
+        Change the error message from #CRASHED to #UNRESPONSIVE PROCESS
+        If there isn't a crash log found for the process add a message saying
+        the process was unresponsive.
+
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        (WebKitDriver.__init__):
+        (WebKitDriver._check_for_driver_crash):
+        (WebKitDriver.run_test):
+        * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
+        (WebKitDriverTest.test_check_for_driver_crash.assert_crash):
+        (WebKitDriverTest):
+        (WebKitDriverTest.test_check_for_driver_crash):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR):
+        (WTR::TestController::runTest):
+
+2012-05-30  Stephanie Lewis  <[email protected]>
+
         https://bugs.webkit.org/show_bug.cgi?id=87714
         Mac crash logs can take a really long time to be written out.
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py (119017 => 119018)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py	2012-05-31 01:51:26 UTC (rev 119017)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py	2012-05-31 01:51:50 UTC (rev 119018)
@@ -449,6 +449,10 @@
         self._crashed_process_name = None
         self._crashed_pid = None
 
+        # WebKitTestRunner can report back subprocesses that became unresponsive
+        # This could mean they crashed.
+        self._subprocess_was_unresponsive = False
+
         # stderr reading is scoped on a per-test (not per-block) basis, so we store the accumulated
         # stderr output, as well as if we've seen #EOF on this driver instance.
         # FIXME: We should probably remove _read_first_block and _read_optional_image_block and
@@ -513,7 +517,8 @@
             # See http://trac.webkit.org/changeset/65537.
             self._crashed_process_name = self._server_process.name()
             self._crashed_pid = self._server_process.pid()
-        elif error_line.startswith("#CRASHED - WebProcess"):
+        elif (error_line.startswith("#CRASHED - WebProcess")
+            or error_line.startswith("#PROCESS UNRESPONSIVE - WebProcess")):
             # WebKitTestRunner uses this to report that the WebProcess subprocess crashed.
             pid = None
             m = re.search('pid (\d+)', error_line)
@@ -523,6 +528,8 @@
             self._crashed_pid = pid
             # FIXME: delete this after we're sure this code is working :)
             _log.debug('WebProcess crash, pid = %s, error_line = %s' % (str(pid), error_line))
+            if error_line.startswith("#PROCESS UNRESPONSIVE - WebProcess"):
+                self._subprocess_was_unresponsive = True
             return True
         return self.has_crashed()
 
@@ -581,6 +588,9 @@
             # If we don't find a crash log use a placeholder error message instead.
             if not crash_log:
                 crash_log = 'no crash log found for %s:%d.' % (self._crashed_process_name, self._crashed_pid)
+                # If we were unresponsive append a message informing there may not have been a crash.
+                if self._subprocess_was_unresponsive:
+                    crash_log += '  Process failed to become responsive before timing out.'
 
         timeout = self._server_process.timed_out
         if timeout:

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py (119017 => 119018)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py	2012-05-31 01:51:26 UTC (rev 119017)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py	2012-05-31 01:51:50 UTC (rev 119018)
@@ -322,10 +322,11 @@
             def stop(self):
                 pass
 
-        def assert_crash(driver, error_line, crashed, name, pid):
+        def assert_crash(driver, error_line, crashed, name, pid, unresponsive=False):
             self.assertEquals(driver._check_for_driver_crash(error_line), crashed)
             self.assertEquals(driver._crashed_process_name, name)
             self.assertEquals(driver._crashed_pid, pid)
+            self.assertEquals(driver._subprocess_was_unresponsive, unresponsive)
             driver.stop()
 
         driver._server_process = FakeServerProcess(False)
@@ -334,21 +335,31 @@
         driver._crashed_process_name = None
         driver._crashed_pid = None
         driver._server_process = FakeServerProcess(False)
+        driver._subprocess_was_unresponsive = False
         assert_crash(driver, '#CRASHED\n', True, 'FakeServerProcess', 1234)
 
         driver._crashed_process_name = None
         driver._crashed_pid = None
         driver._server_process = FakeServerProcess(False)
+        driver._subprocess_was_unresponsive = False
         assert_crash(driver, '#CRASHED - WebProcess\n', True, 'WebProcess', None)
 
         driver._crashed_process_name = None
         driver._crashed_pid = None
         driver._server_process = FakeServerProcess(False)
+        driver._subprocess_was_unresponsive = False
         assert_crash(driver, '#CRASHED - WebProcess (pid 8675)\n', True, 'WebProcess', 8675)
+        
+        driver._crashed_process_name = None
+        driver._crashed_pid = None
+        driver._server_process = FakeServerProcess(False)
+        driver._subprocess_was_unresponsive = False
+        assert_crash(driver, '#PROCESS UNRESPONSIVE - WebProcess (pid 8675)\n', True, 'WebProcess', 8675, True)
 
         driver._crashed_process_name = None
         driver._crashed_pid = None
         driver._server_process = FakeServerProcess(True)
+        driver._subprocess_was_unresponsive = False
         assert_crash(driver, '', True, 'FakeServerProcess', 1234)
 
     def test_creating_a_port_does_not_write_to_the_filesystem(self):

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (119017 => 119018)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2012-05-31 01:51:26 UTC (rev 119017)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2012-05-31 01:51:50 UTC (rev 119018)
@@ -498,9 +498,9 @@
     if (!resetStateToConsistentValues()) {
 #if PLATFORM(MAC)
         pid_t pid = WKPageGetProcessIdentifier(m_mainWebView->page());
-        fprintf(stderr, "#CRASHED - WebProcess (pid %ld)\n", static_cast<long>(pid));
+        fprintf(stderr, "#PROCESS UNRESPONSIVE - WebProcess (pid %ld)\n", static_cast<long>(pid));
 #else
-        fputs("#CRASHED - WebProcess\n", stderr);
+        fputs("#PROCESS UNRESPONSIVE - WebProcess\n", stderr);
 #endif
         fflush(stderr);
         return false;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to