Title: [133768] trunk/Tools
Revision
133768
Author
[email protected]
Date
2012-11-07 09:33:11 -0800 (Wed, 07 Nov 2012)

Log Message

WebKitTestRunner flakily hangs when running pixel tests on Qt
https://bugs.webkit.org/show_bug.cgi?id=100686

Reviewed by Csaba Osztrogonác.

Make WebKitTestRunner harden against the situation when the coordinated
graphics rendering synchronisation fails. If we time out when waiting
for the forced repaint to finish it usually a symptom of the synchronisation
has been broken. In this case all other tests will fail with the same error.
The underlying problem is not yet known. Ths patch make us report this situation
as web process unresponsiveness, so the test harness will kill us and launch
a new instance. This will make our pixel test bot usable while it should not limit
us debugging the underlying bug.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::run):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::TestInvocation):
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::dumpWebProcessUnresponsiveness):
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestInvocation.h:
(TestInvocation): Introduce new members to hold our state
that was local to invoke() so far.
* WebKitTestRunner/qt/TestInvocationQt.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (133767 => 133768)


--- trunk/Tools/ChangeLog	2012-11-07 17:30:56 UTC (rev 133767)
+++ trunk/Tools/ChangeLog	2012-11-07 17:33:11 UTC (rev 133768)
@@ -1,3 +1,32 @@
+2012-11-07  Balazs Kelemen  <[email protected]>
+
+        WebKitTestRunner flakily hangs when running pixel tests on Qt
+        https://bugs.webkit.org/show_bug.cgi?id=100686
+
+        Reviewed by Csaba Osztrogonác.
+
+        Make WebKitTestRunner harden against the situation when the coordinated
+        graphics rendering synchronisation fails. If we time out when waiting
+        for the forced repaint to finish it usually a symptom of the synchronisation
+        has been broken. In this case all other tests will fail with the same error.
+        The underlying problem is not yet known. Ths patch make us report this situation
+        as web process unresponsiveness, so the test harness will kill us and launch
+        a new instance. This will make our pixel test bot usable while it should not limit
+        us debugging the underlying bug.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::run):
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::TestInvocation):
+        (WTR::TestInvocation::invoke):
+        (WTR::TestInvocation::dumpWebProcessUnresponsiveness):
+        (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+        * WebKitTestRunner/TestInvocation.h:
+        (TestInvocation): Introduce new members to hold our state
+        that was local to invoke() so far.
+        * WebKitTestRunner/qt/TestInvocationQt.cpp:
+        (WTR::TestInvocation::dumpPixelsAndCompareWithExpected):
+
 2012-11-07  Allan Sandfeld Jensen  <[email protected]>
 
         [Qt] Open link in this window action

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (133767 => 133768)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2012-11-07 17:30:56 UTC (rev 133767)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2012-11-07 17:33:11 UTC (rev 133768)
@@ -703,7 +703,7 @@
 void TestController::run()
 {
     if (!resetStateToConsistentValues()) {
-        TestInvocation::dumpWebProcessUnresponsiveness("Failed to reset to consistent state before the first test");
+        m_currentInvocation->dumpWebProcessUnresponsiveness();
         return;
     }
 

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (133767 => 133768)


--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2012-11-07 17:30:56 UTC (rev 133767)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2012-11-07 17:33:11 UTC (rev 133768)
@@ -104,6 +104,7 @@
     , m_gotFinalMessage(false)
     , m_gotRepaint(false)
     , m_error(false)
+    , m_webProcessIsUnrensponsive(false)
 {
 }
 
@@ -186,16 +187,14 @@
 
     WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), beginTestMessageBody.get());
 
-    const char* errorMessage = 0;
     TestController::shared().runUntil(m_gotInitialResponse, TestController::ShortTimeout);
     if (!m_gotInitialResponse) {
-        errorMessage = "Timed out waiting for initial response from web process\n";
+        m_errorMessage = "Timed out waiting for initial response from web process\n";
+        m_webProcessIsUnrensponsive = true;
         goto end;
     }
-    if (m_error) {
-        errorMessage = "FAIL\n";
+    if (m_error)
         goto end;
-    }
 
 #if ENABLE(INSPECTOR)
     if (shouldOpenWebInspector(m_pathOrURL.c_str()))
@@ -206,13 +205,12 @@
 
     TestController::shared().runUntil(m_gotFinalMessage, TestController::shared().useWaitToDumpWatchdogTimer() ? TestController::LongTimeout : TestController::NoTimeout);
     if (!m_gotFinalMessage) {
-        errorMessage = "Timed out waiting for final message from web process\n";
+        m_errorMessage = "Timed out waiting for final message from web process\n";
+        m_webProcessIsUnrensponsive = true;
         goto end;
     }
-    if (m_error) {
-        errorMessage = "FAIL\n";
+    if (m_error)
         goto end;
-    }
 
     dumpResults();
 
@@ -222,13 +220,15 @@
         WKInspectorClose(WKPageGetInspector(TestController::shared().mainWebView()->page()));
 #endif // ENABLE(INSPECTOR)
 
-    if (errorMessage)
-        dumpWebProcessUnresponsiveness(errorMessage);
-    else if (!TestController::shared().resetStateToConsistentValues())
-        dumpWebProcessUnresponsiveness("Timed out loading about:blank before the next test");
+    if (m_webProcessIsUnrensponsive)
+        dumpWebProcessUnresponsiveness();
+    else if (!TestController::shared().resetStateToConsistentValues()) {
+        m_errorMessage = "Timed out loading about:blank before the next test";
+        dumpWebProcessUnresponsiveness();
+    }
 }
 
-void TestInvocation::dumpWebProcessUnresponsiveness(const char* textToStdout)
+void TestInvocation::dumpWebProcessUnresponsiveness()
 {
     const char* errorMessageToStderr = 0;
 #if PLATFORM(MAC)
@@ -240,7 +240,7 @@
     errorMessageToStderr = "#PROCESS UNRESPONSIVE - WebProcess";
 #endif
 
-    dump(textToStdout, errorMessageToStderr, true);
+    dump(m_errorMessage.c_str(), errorMessageToStderr, true);
 }
 
 void TestInvocation::dump(const char* textToStdout, const char* textToStderr, bool seenError)
@@ -292,6 +292,7 @@
         m_gotInitialResponse = true;
         m_gotFinalMessage = true;
         m_error = true;
+        m_errorMessage = "FAIL\n";
         TestController::shared().notifyDone();
         return;
     }

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.h (133767 => 133768)


--- trunk/Tools/WebKitTestRunner/TestInvocation.h	2012-11-07 17:30:56 UTC (rev 133767)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.h	2012-11-07 17:33:11 UTC (rev 133768)
@@ -44,7 +44,7 @@
     void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
     WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
 
-    static void dumpWebProcessUnresponsiveness(const char* textToStdout);
+    void dumpWebProcessUnresponsiveness();
 private:
     void dumpResults();
     static void dump(const char* textToStdout, const char* textToStderr = 0, bool seenError = false);
@@ -71,6 +71,9 @@
     WKRetainPtr<WKStringRef> m_textOutput;
     WKRetainPtr<WKImageRef> m_pixelResult;
     WKRetainPtr<WKArrayRef> m_repaintRects;
+    std::string m_errorMessage;
+    bool m_webProcessIsUnrensponsive;
+
 };
 
 } // namespace WTR

Modified: trunk/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp (133767 => 133768)


--- trunk/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp	2012-11-07 17:30:56 UTC (rev 133767)
+++ trunk/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp	2012-11-07 17:33:11 UTC (rev 133768)
@@ -83,10 +83,10 @@
         if (m_gotRepaint)
             image = WKImageCreateQImage(TestController::shared().mainWebView()->windowSnapshotImage().get());
         else {
-            // The test harness expects an image so we output an empty one.
-            WKRect windowRect = TestController::shared().mainWebView()->windowFrame();
-            image = QImage(QSize(windowRect.size.width, windowRect.size.height), QImage::Format_ARGB32_Premultiplied);
-            image.fill(Qt::red);
+            m_error = true;
+            m_errorMessage = "Timed out waiting for repaint\n";
+            m_webProcessIsUnrensponsive = true;
+            return;
         }
     } else
         image = WKImageCreateQImage(imageRef);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to