Bug 233224 - [ Monterey ] TestWebKitAPI.WebSocket.PageWithAttributedBundleIdentifierDestroyed (API-test) is a constant timeout
Summary: [ Monterey ] TestWebKitAPI.WebSocket.PageWithAttributedBundleIdentifierDestro...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-16 16:58 PST by Robert Jenner
Modified: 2021-12-22 09:42 PST (History)
4 users (show)

See Also:


Attachments
Patch (5.48 KB, patch)
2021-12-20 10:56 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (3.47 KB, patch)
2021-12-20 12:47 PST, Alex Christensen
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Jenner 2021-11-16 16:58:15 PST
TestWebKitAPI.WebSocket.PageWithAttributedBundleIdentifierDestroyed is a constant timeout on macOS Monterey. 

HISTORY:
https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.WebSocket.PageWithAttributedBundleIdentifierDestroyed
Comment 1 Radar WebKit Bug Importer 2021-11-16 16:58:52 PST
<rdar://problem/85482210>
Comment 2 Robert Jenner 2021-11-19 11:50:17 PST
I was able to reproduce this timeout on a Release ToT build. Using the following test:

Run-api-tests --release TestWebKitAPI.WebSocket.PageWithAttributedBundleIdentifierDestroyed

I do want to note that I was not able to reproduce this with a Debug or a Production build. I had to specifically download a Release build, and that's where I was easily able to reproduce the timeout.
Comment 3 Alex Christensen 2021-12-20 10:44:11 PST
It seems that setting _attributedBundleIdentifier to a bundle id that doesn't exist causes it to be unable to make a network request.
Comment 4 Alex Christensen 2021-12-20 10:56:03 PST
Created attachment 447611 [details]
Patch
Comment 5 Darin Adler 2021-12-20 12:19:12 PST
Comment on attachment 447611 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=447611&action=review

> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1767
> +    if (!parameters.attributedBundleIdentifier().startsWith("com.apple.webkit.test.bundle.identifier"))

Building the name of the test bundle right into the binary is usually something we try very hard to avoid. Isn’t there some other way the test could inject the evidence that it’s a test configuration?
Comment 6 Darin Adler 2021-12-20 12:19:46 PST
Comment on attachment 447611 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=447611&action=review

>> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1767
>> +    if (!parameters.attributedBundleIdentifier().startsWith("com.apple.webkit.test.bundle.identifier"))
> 
> Building the name of the test bundle right into the binary is usually something we try very hard to avoid. Isn’t there some other way the test could inject the evidence that it’s a test configuration?

Like a separate boolean in the parameters.
Comment 7 Alex Christensen 2021-12-20 12:47:07 PST
Created attachment 447622 [details]
Patch
Comment 8 Alex Christensen 2021-12-20 13:59:19 PST
https://trac.webkit.org/changeset/287275/webkit
Comment 9 Alex Christensen 2021-12-22 09:42:19 PST
r287359 enabled another test fixed by this.