⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 206596 in webkit


Ignore:
Timestamp:
Sep 29, 2016, 11:44:54 AM (10 years ago)
Author:
ap@apple.com
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.

Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r206593 r206596  
     12016-09-29  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Make WKTR short timeout dynamic
     4        https://bugs.webkit.org/show_bug.cgi?id=162733
     5
     6        Reviewed by Alex Christensen.
     7
     8        WebKitTestRunner has a hardcoded value for how long to wait for IPC responses,
     9        which is 5 seconds, or 10 seconds under ASan. But some of the operations can be
     10        fairly time consuming - e.g. launching Networking process on demand.
     11        These may take longer under load, especially with GuardMalloc.
     12
     13        * WebKitTestRunner/TestController.cpp:
     14        (WTR::TestController::resetStateToConsistentValues):
     15        (WTR::TestController::reattachPageToWebProcess):
     16        * WebKitTestRunner/TestController.h:
     17        * WebKitTestRunner/TestInvocation.cpp:
     18        (WTR::TestInvocation::shortTimeout):
     19        (WTR::TestInvocation::invoke):
     20        (WTR::TestInvocation::dumpResults):
     21
     22        * WebKitTestRunner/TestInvocation.h:
     23        (WTR::TestInvocation::customTimeout): Deleted, this function was unused.
     24
    1252016-09-29  Alex Christensen  <achristensen@webkit.org>
    226
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r206449 r206596  
    9090const unsigned TestController::w3cSVGViewHeight = 360;
    9191
    92 #if ASAN_ENABLED
    93 const double TestController::shortTimeout = 10.0;
    94 #else
    95 const double TestController::shortTimeout = 5.0;
    96 #endif
     92const double TestController::defaultShortTimeout = 5.0;
    9793
    9894const double TestController::noTimeout = -1;
    … …  
    798794
    799795    WKPageLoadURL(m_mainWebView->page(), blankURL());
    800     runUntil(m_doneResetting, shortTimeout);
     796    runUntil(m_doneResetting, m_currentInvocation->shortTimeout());
    801797    return m_doneResetting;
    802798}
    … …  
    812808    m_doneResetting = false;
    813809    WKPageLoadURL(m_mainWebView->page(), blankURL());
    814     runUntil(m_doneResetting, shortTimeout);
     810    runUntil(m_doneResetting, m_currentInvocation->shortTimeout());
    815811}
    816812
  • trunk/Tools/WebKitTestRunner/TestController.h

    r204253 r206596  
    5858    static const unsigned w3cSVGViewHeight;
    5959
    60     static const double shortTimeout;
     60    static const double defaultShortTimeout;
    6161    static const double noTimeout;
    6262
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r204877 r206596  
    9999}
    100100
     101double TestInvocation::shortTimeout() const
     102{
     103    if (!m_timeout) {
     104        // Running WKTR directly, without webkitpy.
     105        return TestController::defaultShortTimeout;
     106    }
     107
     108    // This is not exactly correct for the way short timeout is used - it should not depend on whether a test is "slow",
     109    // but it currently does. There is no way to know what a normal test's timeout is, as webkitpy only passes timeouts
     110    // for each test individually.
     111    // But there shouldn't be any observable negative consequences from this.
     112    return m_timeout / 1000. / 2;
     113}
     114
    101115bool TestInvocation::shouldLogFrameLoadDelegates() const
    102116{
    … …  
    150164    bool shouldOpenExternalURLs = false;
    151165
    152     TestController::singleton().runUntil(m_gotInitialResponse, TestController::shortTimeout);
     166    TestController::singleton().runUntil(m_gotInitialResponse, shortTimeout());
    153167    if (!m_gotInitialResponse) {
    154168        m_errorMessage = "Timed out waiting for initial response from web process\n";
    … …  
    254268            m_gotRepaint = false;
    255269            WKPageForceRepaint(TestController::singleton().mainWebView()->page(), this, TestInvocation::forceRepaintDoneCallback);
    256             TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout);
     270            TestController::singleton().runUntil(m_gotRepaint, shortTimeout());
    257271            if (!m_gotRepaint) {
    258272                m_errorMessage = "Timed out waiting for pre-pixel dump repaint\n";
  • trunk/Tools/WebKitTestRunner/TestInvocation.h

    r204877 r206596  
    5050    void setIsPixelTest(const std::string& expectedPixelHash);
    5151
     52    // Milliseconds
    5253    void setCustomTimeout(int duration) { m_timeout = duration; }
    53     int customTimeout() const { return m_timeout; }
     54
     55    // Seconds
     56    double shortTimeout() const;
    5457
    5558    void invoke();
Note: See TracChangeset for help on using the changeset viewer.