Bug 212268 - [WKTR] Make TestController::resetStateToConsistentValues() more robust against failures to navigate to about:blank
Summary: [WKTR] Make TestController::resetStateToConsistentValues() more robust agains...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-22 10:35 PDT by Chris Dumez
Modified: 2020-05-22 11:19 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.59 KB, patch)
2020-05-22 10:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].