Bug 212268

Summary: [WKTR] Make TestController::resetStateToConsistentValues() more robust against failures to navigate to about:blank
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Tools / TestsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, beidson, ggaren, jbedard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2020-05-22 10:35:47 PDT
Make TestController::resetStateToConsistentValues() more robust against failures to navigate to about:blank.

In <rdar://problem/63493074>, we have evidence that TestController::resetStateToConsistentValues() sometimes fails to load about:blank, likely due to an unresponsive WebProcess. When this happens, WebKitTestRunner reports the test as timing out and logs this on stderr:
"""
  <unknown> - TestController::run - Failed to reset state to consistent values
  #PROCESS UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 57421)
"""

This is unfortunate because this does not indicate that anything is particularly wrong with the test in question. Rather, it indicates that the WebProcess is unresponsive (likely due to a hang caused by a previous test), which prevents WebKitTestRunner to reset the state in order to run the test.

I propose that if we fail to load about:blank once, we log an error message to stderr but then terminate the WebProcess and try once again, to make WebKitTestRunner more robust.
I have verified the change locally, by injecting a script in resetStateToConsistentValues() that causes a WebProcess hang. Before my change, the test would time out and the same logging as in <rdar://problem/63493074> would show. After my change though, the test would pass successfully despite the WebProcess hang.
Comment 1 Chris Dumez 2020-05-22 10:35:57 PDT
<rdar://problem/63493074>
Comment 2 Chris Dumez 2020-05-22 10:38:02 PDT
Created attachment 400056 [details]
Patch
Comment 3 Geoffrey Garen 2020-05-22 10:58:33 PDT
Comment on attachment 400056 [details]
Patch

r=me
Comment 4 EWS 2020-05-22 11:19:08 PDT
Committed r262065: <https://trac.webkit.org/changeset/262065>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400056 [details].