Bug 229501 - REGRESSION (r281516): imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https.html is failing
Summary: REGRESSION (r281516): imported/w3c/web-platform-tests/IndexedDB/serialize-sha...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
: 229565 (view as bug list)
Depends on:
Blocks: 229559
  Show dependency treegraph
 
Reported: 2021-08-25 10:23 PDT by ayumi_kojima
Modified: 2021-08-27 10:02 PDT (History)
7 users (show)

See Also:


Attachments
WIP patch (1.99 KB, patch)
2021-08-26 12:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.04 KB, patch)
2021-08-26 13:47 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.27 KB, patch)
2021-08-26 14:19 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.35 KB, patch)
2021-08-26 16:07 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 ayumi_kojima 2021-08-25 10:23:37 PDT
imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https.html

Is a flaky failure on iOS-14-Simulator-WK2-Tests-EWS and macOS-Catalina-Release-WK2-Tests-EWS.

The flaky failure is also showing up in the open source directory: https://results.webkit.org/?suite=layout-tests&test=imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https.html

Result page: https://build.webkit.org/results/Apple-iPadOS-14-Simulator-Release-WK2-Tests/r281555%20(1898)/results.html

Diff:

--- /Volumes/Data/worker/ipados-simulator-14-release-tests-wk2/build/layout-test-results/imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-expected.txt
+++ /Volumes/Data/worker/ipados-simulator-14-release-tests-wk2/build/layout-test-results/imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-actual.txt
@@ -1,3 +1,5 @@
-
-FAIL IndexedDB: Attempting to serialize a SharedArrayBuffer should throw assert_true: The page is served with COOP and COEP, it should be cross-origin-isolated. expected true got false
-
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584

Looks like the flaky failure started at https://trac.webkit.org/changeset/281516/webkit.
Comment 1 Radar WebKit Bug Importer 2021-08-25 10:24:58 PDT
<rdar://problem/82346152>
Comment 2 ayumi_kojima 2021-08-25 10:37:52 PDT
Updated test expectations https://trac.webkit.org/changeset/281561/webkit
Comment 3 Chris Dumez 2021-08-25 10:44:31 PDT
(In reply to ayumi_kojima from comment #2)
> Updated test expectations https://trac.webkit.org/changeset/281561/webkit

Thanks.
Comment 4 Alexey Proskuryakov 2021-08-25 13:35:10 PDT
The title says "flaky", but on most queues, it's a 100% failure.
Comment 5 ayumi_kojima 2021-08-26 09:59:38 PDT
*** Bug 229565 has been marked as a duplicate of this bug. ***
Comment 6 Chris Dumez 2021-08-26 12:35:36 PDT
Created attachment 436548 [details]
WIP patch
Comment 7 Chris Dumez 2021-08-26 13:47:32 PDT
Created attachment 436561 [details]
Patch
Comment 8 Chris Dumez 2021-08-26 14:19:17 PDT
Created attachment 436564 [details]
Patch
Comment 9 ayumi_kojima 2021-08-26 15:19:31 PDT
Just FYI expectation is marked for imported/w3c/web-platform-tests/encoding/sharedarraybuffer.https.html here https://trac.webkit.org/changeset/281626/webkit
Comment 10 ayumi_kojima 2021-08-26 15:20:19 PDT
The bug is already duped.
Comment 11 Alex Christensen 2021-08-26 15:53:15 PDT
Comment on attachment 436564 [details]
Patch

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

> Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:639
> +    // In case of a COOP process-swap, the old process gets a didFailProvisionalLoadWithErrorForFrame delegate call. We want to ignore

Safari also uses didFailProvisionalLoadWithErrorForFrame.  Do we want to prevent this call from WebKit in the case of a COOP process swap?
Comment 12 Chris Dumez 2021-08-26 15:56:43 PDT
(In reply to Alex Christensen from comment #11)
> Comment on attachment 436564 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=436564&action=review
> 
> > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:639
> > +    // In case of a COOP process-swap, the old process gets a didFailProvisionalLoadWithErrorForFrame delegate call. We want to ignore
> 
> Safari also uses didFailProvisionalLoadWithErrorForFrame.  Do we want to
> prevent this call from WebKit in the case of a COOP process swap?

I am not convinced we want to bypass this call at WebKit level. The old process starts a provisional load and this provisional load gets cancelled when we process-swap. I think calling didFailProvisionalLoadWithErrorForFrame() is correct behavior in the old process otherwise, the process would get a didStartProvisionalLoadForFrame call and then nothing else. Wouldn't it be bad too?

I think the issue is really in WebKitTestRunner's injected bundle because the logic there thinks the test failed even though it merely proceeded in a new process.
Comment 13 Chris Dumez 2021-08-26 16:02:15 PDT
Comment on attachment 436564 [details]
Patch

Oh, looks like this is causing http/tests/contentextensions/block-everything-if-domain.html to fail. The test is expected to fail loading before committing any load so it triggers my new logic :/
Comment 14 Chris Dumez 2021-08-26 16:07:01 PDT
Created attachment 436584 [details]
Patch
Comment 15 Chris Dumez 2021-08-26 16:40:14 PDT
(In reply to Alex Christensen from comment #11)
> Comment on attachment 436564 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=436564&action=review
> 
> > Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:639
> > +    // In case of a COOP process-swap, the old process gets a didFailProvisionalLoadWithErrorForFrame delegate call. We want to ignore
> 
> Safari also uses didFailProvisionalLoadWithErrorForFrame.  Do we want to
> prevent this call from WebKit in the case of a COOP process swap?

To be clear, I think we should call didFailProvisionalLoadWithErrorForFrame in the injected bundle in the old process (since it got a didStartProvisionalLoadForFrame and since the load gets cancelled in that process). However, we should definitely not call didFailProvisionalLoadWithErrorForFrame() at UIProcess level. We may have a bug there. I will follow-up to add a test and fix if we indeed have that bug.
Comment 16 Chris Dumez 2021-08-26 19:20:34 PDT
Comment on attachment 436584 [details]
Patch

EWS is happy
Comment 17 EWS 2021-08-27 10:02:33 PDT
Committed r281699 (241049@main): <https://commits.webkit.org/241049@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 436584 [details].