TestWebKitAPI.WebKit2.CaptureIndicatorDelay Is failing on macOS Debug. History: https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.WebKit2.CaptureIndicatorDelay TestWebKitAPI.WebKit2.CaptureIndicatorDelay 2021-09-27 08:06:21.207 TestWebKitAPI[35291:3521683] Encountered error: Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScriptExceptionLineNumber=22, WKJavaScriptExceptionMessage=TypeError: null is not an object (evaluating 'stream.getTracks'), WKJavaScriptExceptionColumnNumber=23, WKJavaScriptExceptionSourceURL=file:///Volumes/Data/worker/bigsur-debug-tests-wk2/build/WebKitBuild/Debug/TestWebKitAPI.resources/getUserMedia.html, NSLocalizedDescription=A JavaScript exception occurred} while evaluating script: stop() 2021-09-27 08:06:32.214 TestWebKitAPI[35291:3521683] Expected state _WKMediaCaptureStateDeprecatedNone, but after 10 seconds state is _WKMediaCaptureStateDeprecatedActiveCamera LEAK: 1 WebProcessPool LEAK: 1 WebPageProxy /Volumes/Data/worker/bigsur-debug/build/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:211 Value of: !error Actual: false Expected: true /Volumes/Data/worker/bigsur-debug/build/Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:405 Value of: waitUntilCaptureState(webView.get(), _WKMediaCaptureStateDeprecatedNone) Actual: false Expected: true
<rdar://problem/83577251>
According to the history, the test started failing at https://trac.webkit.org/changeset/283102/webkit
This change was reverted again. *** This bug has been marked as a duplicate of bug 230854 ***
Relanding unlinked baseline. Need to figure this out
I think my patch just perturbed a pre-existing race.
Created attachment 439421 [details] patch
Comment on attachment 439421 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=439421&action=review > Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:398 > + [webView stringByEvaluatingJavaScript:@"setTimeout(stop, 0)"]; I think this might still be racy, at least in theory. Let's make it bullet proof by waiting for getUserMedia promise resolution to actually call stop.
Created attachment 439439 [details] Patch
Created attachment 439463 [details] Patch
Created attachment 439470 [details] Patch
Committed r283172 (242220@main): <https://commits.webkit.org/242220@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 439470 [details].