Bug 230847 - REGRESSION (r283102): [ MacOS Debug ] TestWebKitAPI.WebKit2.CaptureIndicatorDelay is failing
Summary: REGRESSION (r283102): [ MacOS Debug ] TestWebKitAPI.WebKit2.CaptureIndicatorD...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac (Intel) Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-27 09:39 PDT by ayumi_kojima
Modified: 2021-09-28 09:17 PDT (History)
5 users (show)

See Also:


Attachments
patch (1.18 KB, patch)
2021-09-27 17:49 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
Patch (2.70 KB, patch)
2021-09-28 01:08 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (1.75 KB, patch)
2021-09-28 05:54 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (1.74 KB, patch)
2021-09-28 06:39 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ayumi_kojima 2021-09-27 09:39:13 PDT
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
Comment 1 Radar WebKit Bug Importer 2021-09-27 09:40:11 PDT
<rdar://problem/83577251>
Comment 2 ayumi_kojima 2021-09-27 09:43:04 PDT
According to the history, the test started failing at https://trac.webkit.org/changeset/283102/webkit
Comment 3 Alexey Proskuryakov 2021-09-27 12:50:31 PDT
This change was reverted again.

*** This bug has been marked as a duplicate of bug 230854 ***
Comment 4 Saam Barati 2021-09-27 13:25:41 PDT
Relanding unlinked baseline. Need to figure this out
Comment 5 Saam Barati 2021-09-27 17:44:29 PDT
I think my patch just perturbed a pre-existing race.
Comment 6 Saam Barati 2021-09-27 17:49:37 PDT
Created attachment 439421 [details]
patch
Comment 7 youenn fablet 2021-09-28 01:05:47 PDT
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.
Comment 8 youenn fablet 2021-09-28 01:08:13 PDT
Created attachment 439439 [details]
Patch
Comment 9 youenn fablet 2021-09-28 05:54:38 PDT
Created attachment 439463 [details]
Patch
Comment 10 youenn fablet 2021-09-28 06:39:31 PDT
Created attachment 439470 [details]
Patch
Comment 11 EWS 2021-09-28 09:17:32 PDT
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].