Bug 198435 - Layout test landed flaky in 245873 [ Release ] http/wpt/service-workers/service-worker-networkprocess-crash.html is a flaky failure
Summary: Layout test landed flaky in 245873 [ Release ] http/wpt/service-workers/servi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-05-31 14:03 PDT by Shawn Roberts
Modified: 2019-06-05 15:42 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.65 KB, patch)
2019-05-31 16:48 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 Shawn Roberts 2019-05-31 14:03:44 PDT
The following layout test is flaky on Mac WK2 and iOS Simulator Release builds

http/wpt/service-workers/service-worker-networkprocess-crash.html

Probable cause:

New test added in r245873 is a flaky failure on Release builds. 

When run in Debug will get a flaky assertion, or cause other tests to assert. see https://bugs.webkit.org/show_bug.cgi?id=198434

run-webkit-tests http/wpt/service-workers/service-worker-networkprocess-crash.html --iter 100 -f --exit-after-n-failures=2

Flakiness Dashboard:

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Fwpt%2Fservice-workers%2Fservice-worker-networkprocess-crash.html

Diff:

--- /Volumes/Data/slave/ios-simulator-12-release-tests-wk2/build/layout-test-results/http/wpt/service-workers/service-worker-networkprocess-crash-expected.txt
+++ /Volumes/Data/slave/ios-simulator-12-release-tests-wk2/build/layout-test-results/http/wpt/service-workers/service-worker-networkprocess-crash-actual.txt
@@ -1,5 +1,6 @@
+
 
 PASS Setup worker 
 PASS Frame being controlled 
-PASS Frame being controlled after network process crash 
+FAIL Frame being controlled after network process crash assert_not_equals: got disallowed value null
Comment 1 Radar WebKit Bug Importer 2019-05-31 14:04:15 PDT
<rdar://problem/51314295>
Comment 2 youenn fablet 2019-05-31 16:48:37 PDT
Created attachment 371098 [details]
Patch
Comment 3 youenn fablet 2019-06-04 15:54:30 PDT
ping review
Comment 4 Geoffrey Garen 2019-06-04 16:50:07 PDT
r=me

> LayoutTests/http/wpt/service-workers/service-worker-networkprocess-crash.html:59
> +    let count = 0;
> +    while (count++ < 20) {
> +        const frame = await withFrame(scope + "/empty.html");
> +        if (frame.contentWindow.navigator.serviceWorker.controller)
> +            break;
> +        frame.remove();
> +        await new Promise(resolve => setTimeout(resolve, 50));
> +    }
> +    assert_true(count < 20);

Seems like it would be nicer to load the frame only once and then check repeatedly that it eventually gets a service worker. The way this test is written, the frame might never get a service worker, and the test wouldn't notice.
Comment 5 WebKit Commit Bot 2019-06-04 17:11:16 PDT
Comment on attachment 371098 [details]
Patch

Clearing flags on attachment: 371098

Committed r246089: <https://trac.webkit.org/changeset/246089>
Comment 6 WebKit Commit Bot 2019-06-04 17:11:17 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 youenn fablet 2019-06-05 10:47:12 PDT
> Seems like it would be nicer to load the frame only once and then check
> repeatedly that it eventually gets a service worker. The way this test is
> written, the frame might never get a service worker, and the test wouldn't
> notice.

There is an inherent race condition between terminating the network process in UIProcess and detecting network process crash on web process based on IPC connection being closed.
The flakiness here is due to the fact that webprocess checks for a matching registration, then is informed the network process crashes and continues the load as if there is no service worker.
We could probably try to make it work in the future.
Comment 8 youenn fablet 2019-06-05 12:38:20 PDT
Dashboard still shows some flakiness.
Comment 9 youenn fablet 2019-06-05 15:03:49 PDT
(In reply to youenn fablet from comment #8)
> Dashboard still shows some flakiness.

Network process maybe be crashing before the SW SQL database is written on disk.
On restart, there is no service worker.
I'll fix it.
Comment 10 youenn fablet 2019-06-05 15:41:57 PDT
(In reply to youenn fablet from comment #9)
> (In reply to youenn fablet from comment #8)
> > Dashboard still shows some flakiness.
> 
> Network process maybe be crashing before the SW SQL database is written on
> disk.
> On restart, there is no service worker.
> I'll fix it.

Filed bug 198584