Changeset 280619 in webkit
- Timestamp:
- Aug 3, 2021, 3:23:44 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (modified) (1 diff)
-
WebKitTestRunner/TestInvocation.cpp (modified) (4 diffs)
-
WebKitTestRunner/TestInvocation.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r280618 r280619 1 2021-08-03 Jer Noble <jer.noble@apple.com> 2 3 WebKitTestRunner should dump current results in the case of a timeout 4 https://bugs.webkit.org/show_bug.cgi?id=228706 5 <rdar://79154019> 6 7 Reviewed by Jonathan Bedard. 8 9 When WKTR encounters a timeout, it current prints a "PID UNRESPONSIVE" and "FAIL: timed out" message, 10 but the WebContent process may not actually be unresponsive; it may just be waiting for an event 11 which hasn't fired, or a condition to become true. In these cases, it would be very helpful to see 12 the results of the test so far, so as to diagnose what is keeping the test from running to completion. 13 14 When, in the WKTR process, TestInvocation's "waitToDumpWatchdogTimer" fires, first try sending a message 15 to the InjectedBundle, requesting it to "ForceImmediateCompletion". Only if this message fails to be 16 acted upon will WKTR print the "PID UNRESPONSIVE" message. 17 18 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 19 (WTR::InjectedBundle::didReceiveMessageToPage): 20 * WebKitTestRunner/TestInvocation.cpp: 21 (WTR::TestInvocation::TestInvocation): 22 (WTR::TestInvocation::waitToDumpWatchdogTimerFired): 23 (WTR::TestInvocation::initializeWaitForPostDumpWatchdogTimerIfNeeded): 24 (WTR::TestInvocation::invalidateWaitForPostDumpWatchdogTimer): 25 (WTR::TestInvocation::waitForPostDumpWatchdogTimerFired): 26 (WTR::TestInvocation::done): 27 * WebKitTestRunner/TestInvocation.h: 28 1 29 2021-08-03 Jonathan Bedard <jbedard@apple.com> 2 30 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r280288 r280619 487 487 } 488 488 489 if (WKStringIsEqualToUTF8CString(messageName, "ForceImmediateCompletion")) { 490 m_testRunner->forceImmediateCompletion(); 491 return; 492 } 493 489 494 postPageMessage("Error", "Unknown"); 490 495 } -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r280288 r280619 81 81 , m_url(url) 82 82 , m_waitToDumpWatchdogTimer(RunLoop::main(), this, &TestInvocation::waitToDumpWatchdogTimerFired) 83 , m_waitForPostDumpWatchdogTimer(RunLoop::main(), this, &TestInvocation::waitForPostDumpWatchdogTimerFired) 83 84 { 84 85 m_urlString = toWTFString(adoptWK(WKURLCopyString(m_url.get())).get()); … … 1636 1637 { 1637 1638 invalidateWaitToDumpWatchdogTimer(); 1639 1640 outputText("FAIL: Timed out waiting for notifyDone to be called\n\n"); 1641 1642 postPageMessage("ForceImmediateCompletion"); 1643 1644 initializeWaitForPostDumpWatchdogTimerIfNeeded(); 1645 } 1646 1647 void TestInvocation::initializeWaitForPostDumpWatchdogTimerIfNeeded() 1648 { 1649 if (m_waitForPostDumpWatchdogTimer.isActive()) 1650 return; 1651 1652 m_waitForPostDumpWatchdogTimer.startOneShot(shortTimeout()); 1653 } 1654 1655 void TestInvocation::invalidateWaitForPostDumpWatchdogTimer() 1656 { 1657 m_waitForPostDumpWatchdogTimer.stop(); 1658 } 1659 1660 void TestInvocation::waitForPostDumpWatchdogTimerFired() 1661 { 1662 invalidateWaitForPostDumpWatchdogTimer(); 1638 1663 1639 1664 #if PLATFORM(COCOA) … … 1642 1667 outputText(buffer); 1643 1668 #endif 1644 outputText("FAIL: Timed out waiting for notifyDone to be called\n\n");1645 1669 done(); 1646 1670 } … … 1657 1681 m_gotFinalMessage = true; 1658 1682 invalidateWaitToDumpWatchdogTimer(); 1683 invalidateWaitForPostDumpWatchdogTimer(); 1659 1684 RunLoop::main().dispatch([] { 1660 1685 TestController::singleton().notifyDone(); -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r279750 r280619 115 115 void invalidateWaitToDumpWatchdogTimer(); 116 116 117 void waitForPostDumpWatchdogTimerFired(); 118 void initializeWaitForPostDumpWatchdogTimerIfNeeded(); 119 void invalidateWaitForPostDumpWatchdogTimer(); 120 117 121 void done(); 118 122 void setWaitUntilDone(bool); … … 146 150 String m_urlString; 147 151 RunLoop::Timer<TestInvocation> m_waitToDumpWatchdogTimer; 152 RunLoop::Timer<TestInvocation> m_waitForPostDumpWatchdogTimer; 148 153 149 154 std::string m_expectedPixelHash;
Note:
See TracChangeset
for help on using the changeset viewer.