Title: [206596] trunk/Tools
Revision
206596
Author
a...@apple.com
Date
2016-09-29 11:44:54 -0700 (Thu, 29 Sep 2016)

Log Message

Make WKTR short timeout dynamic
https://bugs.webkit.org/show_bug.cgi?id=162733

Reviewed by Alex Christensen.

WebKitTestRunner has a hardcoded value for how long to wait for IPC responses,
which is 5 seconds, or 10 seconds under ASan. But some of the operations can be
fairly time consuming - e.g. launching Networking process on demand.
These may take longer under load, especially with GuardMalloc.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::reattachPageToWebProcess):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::shortTimeout):
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::dumpResults):

* WebKitTestRunner/TestInvocation.h:
(WTR::TestInvocation::customTimeout): Deleted, this function was unused.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (206595 => 206596)


--- trunk/Tools/ChangeLog	2016-09-29 18:44:53 UTC (rev 206595)
+++ trunk/Tools/ChangeLog	2016-09-29 18:44:54 UTC (rev 206596)
@@ -1,3 +1,27 @@
+2016-09-29  Alexey Proskuryakov  <a...@apple.com>
+
+        Make WKTR short timeout dynamic
+        https://bugs.webkit.org/show_bug.cgi?id=162733
+
+        Reviewed by Alex Christensen.
+
+        WebKitTestRunner has a hardcoded value for how long to wait for IPC responses,
+        which is 5 seconds, or 10 seconds under ASan. But some of the operations can be
+        fairly time consuming - e.g. launching Networking process on demand.
+        These may take longer under load, especially with GuardMalloc.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetStateToConsistentValues):
+        (WTR::TestController::reattachPageToWebProcess):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::shortTimeout):
+        (WTR::TestInvocation::invoke):
+        (WTR::TestInvocation::dumpResults):
+
+        * WebKitTestRunner/TestInvocation.h:
+        (WTR::TestInvocation::customTimeout): Deleted, this function was unused.
+
 2016-09-29  Alex Christensen  <achristen...@webkit.org>
 
         URLParser should fail to parse unclosed IPv6 addresses

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (206595 => 206596)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2016-09-29 18:44:53 UTC (rev 206595)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2016-09-29 18:44:54 UTC (rev 206596)
@@ -89,11 +89,7 @@
 const unsigned TestController::w3cSVGViewWidth = 480;
 const unsigned TestController::w3cSVGViewHeight = 360;
 
-#if ASAN_ENABLED
-const double TestController::shortTimeout = 10.0;
-#else
-const double TestController::shortTimeout = 5.0;
-#endif
+const double TestController::defaultShortTimeout = 5.0;
 
 const double TestController::noTimeout = -1;
 
@@ -797,7 +793,7 @@
     setIgnoresViewportScaleLimits(options.ignoresViewportScaleLimits);
 
     WKPageLoadURL(m_mainWebView->page(), blankURL());
-    runUntil(m_doneResetting, shortTimeout);
+    runUntil(m_doneResetting, m_currentInvocation->shortTimeout());
     return m_doneResetting;
 }
 
@@ -811,7 +807,7 @@
     // Loading a web page is the only way to reattach an existing page to a process.
     m_doneResetting = false;
     WKPageLoadURL(m_mainWebView->page(), blankURL());
-    runUntil(m_doneResetting, shortTimeout);
+    runUntil(m_doneResetting, m_currentInvocation->shortTimeout());
 }
 
 const char* TestController::webProcessName()

Modified: trunk/Tools/WebKitTestRunner/TestController.h (206595 => 206596)


--- trunk/Tools/WebKitTestRunner/TestController.h	2016-09-29 18:44:53 UTC (rev 206595)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2016-09-29 18:44:54 UTC (rev 206596)
@@ -57,7 +57,7 @@
     static const unsigned w3cSVGViewWidth;
     static const unsigned w3cSVGViewHeight;
 
-    static const double shortTimeout;
+    static const double defaultShortTimeout;
     static const double noTimeout;
 
     TestController(int argc, const char* argv[]);

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (206595 => 206596)


--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2016-09-29 18:44:53 UTC (rev 206595)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2016-09-29 18:44:54 UTC (rev 206596)
@@ -98,6 +98,20 @@
     m_expectedPixelHash = expectedPixelHash;
 }
 
+double TestInvocation::shortTimeout() const
+{
+    if (!m_timeout) {
+        // Running WKTR directly, without webkitpy.
+        return TestController::defaultShortTimeout;
+    }
+
+    // This is not exactly correct for the way short timeout is used - it should not depend on whether a test is "slow",
+    // but it currently does. There is no way to know what a normal test's timeout is, as webkitpy only passes timeouts
+    // for each test individually.
+    // But there shouldn't be any observable negative consequences from this.
+    return m_timeout / 1000. / 2;
+}
+
 bool TestInvocation::shouldLogFrameLoadDelegates() const
 {
     return urlContains("loading/");
@@ -149,7 +163,7 @@
 
     bool shouldOpenExternalURLs = false;
 
-    TestController::singleton().runUntil(m_gotInitialResponse, TestController::shortTimeout);
+    TestController::singleton().runUntil(m_gotInitialResponse, shortTimeout());
     if (!m_gotInitialResponse) {
         m_errorMessage = "Timed out waiting for initial response from web process\n";
         m_webProcessIsUnresponsive = true;
@@ -253,7 +267,7 @@
         else if (m_pixelResultIsPending) {
             m_gotRepaint = false;
             WKPageForceRepaint(TestController::singleton().mainWebView()->page(), this, TestInvocation::forceRepaintDoneCallback);
-            TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout);
+            TestController::singleton().runUntil(m_gotRepaint, shortTimeout());
             if (!m_gotRepaint) {
                 m_errorMessage = "Timed out waiting for pre-pixel dump repaint\n";
                 m_webProcessIsUnresponsive = true;

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.h (206595 => 206596)


--- trunk/Tools/WebKitTestRunner/TestInvocation.h	2016-09-29 18:44:53 UTC (rev 206595)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.h	2016-09-29 18:44:54 UTC (rev 206596)
@@ -49,9 +49,12 @@
 
     void setIsPixelTest(const std::string& expectedPixelHash);
 
+    // Milliseconds
     void setCustomTimeout(int duration) { m_timeout = duration; }
-    int customTimeout() const { return m_timeout; }
 
+    // Seconds
+    double shortTimeout() const;
+
     void invoke();
     void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
     WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to