My team has a set of XCTestCases which create a new instance of WKWebView, execute some javascript with it, then assert some conditions afterward.
Beginning with iOS 16, these tests never succeed because it seems like the WKWebView is experiencing some sort of crash or malfunction in its content process.
When executing a single test of the type above, the following is present in the console:
[Process] 0x142481000 - [PID=0] WebProcessProxy::didFinishLaunching: Invalid connection identifier (web process failed to launch)
[Process] 0x142481000 - [PID=0] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
[Process] 0x7f7d86008220 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason=Crash
[Loading] 0x7f7d86008220 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
[Loading] 0x7f7d86008220 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: Not eagerly reloading the view because it is not currently visible
I've tried ensuring that an app host is present for the test target these tests execute in and that had no effect. I've tried adding the webview to the apps view hierarchy and that had no effect.
In iOS 15 and prior these same tests execute and pass fine.
Was there some change in iOS 16 that may have caused this or any ideas on how to rectify this?
We have the same issue, in the unit-tests of a swift-package. In our case, moving the tests to a test target under the sample app didn't help. FB8885728.