Skip to content

Commit 2535af1

Browse files
youennfmnutt
authored andcommitted
REGRESSION(286686@main?): [macOS] http/tests/workers/service/shownotification-allowed.html is a constant failure (flaky in EWS)
rdar://140875944 https://bugs.webkit.org/show_bug.cgi?id=283999 Reviewed by Chris Dumez. http/tests/workers/service/shownotification-allowed.html was failing as we were: - stopping the service worker due to network process crash - recreating the service worker, but in a different process from the web page - sending a message to the web page via self.clients - But the web page is not reregistering it as a service worker client since it does not create a new connection to the network process. To fix this, we make sure the web page recreates a connection to the network process and we make sure the service worker loops until it can send the message to at least one client. * LayoutTests/http/tests/workers/service/resources/shownotification-worker.js: (let.messageClients): * LayoutTests/http/tests/workers/service/shownotification-allowed.html: * LayoutTests/platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/287520@main
1 parent 8547e8b commit 2535af1

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

LayoutTests/http/tests/workers/service/resources/shownotification-worker.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ let messageClients = async function(msg) {
44
includeUncontrolled: true
55
});
66

7+
if (!allClients.length) {
8+
await new Promise(resolve => setTimeout(resolve, 50));
9+
return messageClients(msg);
10+
}
11+
712
for (const client of allClients)
813
client.postMessage(msg);
914
}

LayoutTests/http/tests/workers/service/shownotification-allowed.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
await internals.storeRegistrationsOnDisk();
5555
if (window.testRunner)
5656
testRunner.terminateNetworkProcess();
57+
// After a network process crash, we do a fetch to register as a service worker client to the new network process.
58+
await fetch("").then(() => { }, () => { });
59+
await fetch("").then(() => { }, () => { });
5760

5861
if (testRunner)
5962
testRunner.simulateWebNotificationClickForServiceWorkerNotifications();

LayoutTests/platform/mac-wk2/TestExpectations

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,19 +1344,19 @@ webkit.org/b/240821 webgl/max-active-contexts-webglcontextlost-prevent-default.h
13441344

13451345
webkit.org/b/241265 [ Debug ] imported/w3c/web-platform-tests/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-object-percentage.html [ Pass Crash ]
13461346

1347-
# NOTIFICATION_EVENT is Ventura+
1348-
[ Ventura+ ] http/tests/workers/service/shownotification-allowed-document.html [ Pass ]
1349-
[ Ventura+ ] http/tests/workers/service/shownotification-invalid-data.html [ Pass ]
1350-
[ Ventura+ ] http/wpt/push-api/pushEvent.any.serviceworker.html [ Pass ]
1351-
[ Ventura+ ] imported/w3c/web-platform-tests/notifications/idlharness.https.any.html [ Pass ]
1352-
[ Ventura+ ] imported/w3c/web-platform-tests/notifications/idlharness.https.any.serviceworker.html [ Pass ]
1353-
[ Ventura+ ] imported/w3c/web-platform-tests/notifications/idlharness.https.any.worker.html [ Pass ]
1354-
[ Ventura+ ] http/tests/workers/service/getnotifications-stop.html [ Pass ]
1355-
[ Ventura+ ] http/tests/workers/service/getnotifications.html [ Pass ]
1356-
[ Ventura+ ] http/wpt/service-workers/push-console-messages-no-showNotification.https.html [ Pass ]
1357-
[ Ventura+ ] http/wpt/service-workers/push-console-messages-showNotification-async.https.html [ Pass ]
1358-
[ Ventura+ ] http/wpt/service-workers/push-console-messages-showNotification-late.https.html [ Pass ]
1359-
[ Ventura+ ] http/wpt/service-workers/push-console-messages-showNotification-sync.https.html [ Pass ]
1347+
http/tests/workers/service/shownotification-allowed-document.html [ Pass ]
1348+
http/tests/workers/service/shownotification-allowed.html [ Pass ]
1349+
http/tests/workers/service/shownotification-invalid-data.html [ Pass ]
1350+
http/wpt/push-api/pushEvent.any.serviceworker.html [ Pass ]
1351+
imported/w3c/web-platform-tests/notifications/idlharness.https.any.html [ Pass ]
1352+
imported/w3c/web-platform-tests/notifications/idlharness.https.any.serviceworker.html [ Pass ]
1353+
imported/w3c/web-platform-tests/notifications/idlharness.https.any.worker.html [ Pass ]
1354+
http/tests/workers/service/getnotifications-stop.html [ Pass ]
1355+
http/tests/workers/service/getnotifications.html [ Pass ]
1356+
http/wpt/service-workers/push-console-messages-no-showNotification.https.html [ Pass ]
1357+
http/wpt/service-workers/push-console-messages-showNotification-async.https.html [ Pass ]
1358+
http/wpt/service-workers/push-console-messages-showNotification-late.https.html [ Pass ]
1359+
http/wpt/service-workers/push-console-messages-showNotification-sync.https.html [ Pass ]
13601360

13611361
webkit.org/b/242164 imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https.html [ Failure ]
13621362

@@ -1936,9 +1936,6 @@ webkit.org/b/283210 http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavai
19361936

19371937
webkit.org/b/283596 [ Sequoia+ Debug ] ipc/cfnetwork-crashes-with-string-to-string-http-headers.html [ Skip ]
19381938

1939-
# webkit.org/b/283999 REGRESSION(286110@main?): [macOS] http/tests/workers/service/shownotification-allowed.html is a constant failure (flaky in EWS)
1940-
[ Ventura+ ] http/tests/workers/service/shownotification-allowed.html [ Failure ]
1941-
19421939
# webkit.org/b/284113 REGRESSION(287390@main?): [macOS Release] 4x imported/w3c/web-platform-tests/fs tests are flaky (Failure in EWS)
19431940
[ Release ] imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-postMessage-Error.https.window.html [ Pass Failure ]
19441941
[ Release ] imported/w3c/web-platform-tests/fs/FileSystemFileHandle-getFile.https.any.worker.html [ Pass Failure ]

0 commit comments

Comments
 (0)