Bug 197333

Summary: [WKTR] Move test timeout handling to the UIProcess
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Tools / TestsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, beidson, commit-queue, darin, ggaren, jbedard, lforschler, rniwa, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Chris Dumez
Reported 2019-04-26 16:48:57 PDT
Move test timeout handling in WebKitTestRunner to the UIProcess to play nicely with PSON. Previous, we'd start the timeout timer in the InjectedBundle, which would fail to account of the time spent in every WebContent process in the case of swapping. Also, because of process caching, the timeout timer would sometime fire in a cached process and it would lead to crashes like so: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.JavaScriptCore 0x0000000740b0269e WTFCrash + 14 (Assertions.cpp:305) 1 com.apple.WebKitTestRunner.InjectedBundle 0x00000001b629acd9 WTF::CrashOnOverflow::crash() + 9 2 com.apple.WebKitTestRunner.InjectedBundle 0x00000001b629aca9 WTF::CrashOnOverflow::overflowed() + 9 3 com.apple.WebKitTestRunner.InjectedBundle 0x00000001b62ad16b WTF::Vector<std::__1::unique_ptr<WTR::InjectedBundlePage, std::__1::default_delete<WTR::InjectedBundlePage> >, 0ul, WTF::CrashOnOverflow, 16ul>::at(unsigned long) const + 75 4 com.apple.WebKitTestRunner.InjectedBundle 0x00000001b62a79dd WTF::Vector<std::__1::unique_ptr<WTR::InjectedBundlePage, std::__1::default_delete<WTR::InjectedBundlePage> >, 0ul, WTF::CrashOnOverflow, 16ul>::operator[](unsigned long) const + 29 (Vector.h:720) 5 com.apple.WebKitTestRunner.InjectedBundle 0x00000001b62a79ad WTR::InjectedBundle::page() const + 29 (InjectedBundle.cpp:168) 6 com.apple.WebKitTestRunner.InjectedBundle 0x00000001b62a80a6 WTR::InjectedBundle::outputText(WTF::String const&) + 150 (InjectedBundle.cpp:617) 7 com.apple.WebKitTestRunner.InjectedBundle 0x00000001b62d9158 WTR::TestRunner::waitToDumpWatchdogTimerFired() + 184 (TestRunner.cpp:192) 8 com.apple.WebKitTestRunner.InjectedBundle 0x00000001b62f1a55 WTR::waitUntilDoneWatchdogTimerFired(__CFRunLoopTimer*, void*) + 37 (TestRunnerMac.mm:51) 9 com.apple.CoreFoundation 0x00007fff44e8a9e5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20 10 com.apple.CoreFoundation 0x00007fff44e8a59f __CFRunLoopDoTimer + 859 11 com.apple.CoreFoundation 0x00007fff44e89fc5 __CFRunLoopDoTimers + 317 12 com.apple.CoreFoundation 0x00007fff44e6b2bb __CFRunLoopRun + 2213 13 com.apple.CoreFoundation 0x00007fff44e6a791 CFRunLoopRunSpecific + 499 14 com.apple.Foundation 0x00007fff474b7fa3 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 15 com.apple.Foundation 0x00007fff474b7ebc -[NSRunLoop(NSRunLoop) run] + 76 16 libxpc.dylib 0x00007fff7b677bca _xpc_objc_main.cold.4 + 38 17 libxpc.dylib 0x00007fff7b66abb9 _xpc_objc_main + 470 18 libxpc.dylib 0x00007fff7b66a72d xpc_main + 377 19 com.apple.WebKit 0x00000007206add2a WebKit::XPCServiceMain(int, char const**) + 1322 (XPCServiceMain.mm:147) 20 com.apple.WebKit 0x00000007204e3ecb WKXPCServiceMain + 27 (WKMain.mm:34) 21 com.apple.WebKit.WebContent 0x000000010658defe main + 94 (AuxiliaryProcessMain.cpp:32) 22 libdyld.dylib 0x00007fff7b4201b1 start + 1
Attachments
Patch (17.40 KB, patch)
2019-04-26 16:51 PDT, Chris Dumez
no flags
Patch (17.81 KB, patch)
2019-04-26 16:53 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2019-04-26 16:51:01 PDT
Chris Dumez
Comment 2 2019-04-26 16:53:05 PDT
WebKit Commit Bot
Comment 3 2019-04-27 15:45:44 PDT
Comment on attachment 368367 [details] Patch Clearing flags on attachment: 368367 Committed r244723: <https://trac.webkit.org/changeset/244723>
WebKit Commit Bot
Comment 4 2019-04-27 15:45:46 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 5 2019-04-27 15:48:36 PDT
Jonathan Bedard
Comment 6 2019-04-29 09:59:44 PDT
I think with PSON changes, something like this makes sense. It's probably a performance win for layout tests, but I don't have the numbers to back up that claim. Although, I must question what made you think to do this, because I would have expected that the timeouts a level up (in run-webkit-tests) would have caught most of these cases.
Chris Dumez
Comment 7 2019-04-29 10:55:27 PDT
(In reply to Jonathan Bedard from comment #6) > I think with PSON changes, something like this makes sense. It's probably a > performance win for layout tests, but I don't have the numbers to back up > that claim. > > Although, I must question what made you think to do this, because I would > have expected that the timeouts a level up (in run-webkit-tests) would have > caught most of these cases. The crashes above when I run the layout tests locally is what pushed to me fix this.
Note You need to log in before you can comment on or make changes to this bug.