Skip to content

Commit

Permalink
REGRESSION(286686@main?): [macOS] http/tests/workers/service/shownoti…
Browse files Browse the repository at this point in the history
…fication-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
  • Loading branch information
youennf committed Dec 8, 2024
1 parent 3440db2 commit 11f3d06
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ let messageClients = async function(msg) {
includeUncontrolled: true
});

if (!allClients.length) {
await new Promise(resolve => setTimeout(resolve, 50));
return messageClients(msg);
}

for (const client of allClients)
client.postMessage(msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
await internals.storeRegistrationsOnDisk();
if (window.testRunner)
testRunner.terminateNetworkProcess();
// After a network process crash, we do a fetch to register as a service worker client to the new network process.
await fetch("").then(() => { }, () => { });
await fetch("").then(() => { }, () => { });

if (testRunner)
testRunner.simulateWebNotificationClickForServiceWorkerNotifications();
Expand Down
29 changes: 13 additions & 16 deletions LayoutTests/platform/mac-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1344,19 +1344,19 @@ webkit.org/b/240821 webgl/max-active-contexts-webglcontextlost-prevent-default.h

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

# NOTIFICATION_EVENT is Ventura+
[ Ventura+ ] http/tests/workers/service/shownotification-allowed-document.html [ Pass ]
[ Ventura+ ] http/tests/workers/service/shownotification-invalid-data.html [ Pass ]
[ Ventura+ ] http/wpt/push-api/pushEvent.any.serviceworker.html [ Pass ]
[ Ventura+ ] imported/w3c/web-platform-tests/notifications/idlharness.https.any.html [ Pass ]
[ Ventura+ ] imported/w3c/web-platform-tests/notifications/idlharness.https.any.serviceworker.html [ Pass ]
[ Ventura+ ] imported/w3c/web-platform-tests/notifications/idlharness.https.any.worker.html [ Pass ]
[ Ventura+ ] http/tests/workers/service/getnotifications-stop.html [ Pass ]
[ Ventura+ ] http/tests/workers/service/getnotifications.html [ Pass ]
[ Ventura+ ] http/wpt/service-workers/push-console-messages-no-showNotification.https.html [ Pass ]
[ Ventura+ ] http/wpt/service-workers/push-console-messages-showNotification-async.https.html [ Pass ]
[ Ventura+ ] http/wpt/service-workers/push-console-messages-showNotification-late.https.html [ Pass ]
[ Ventura+ ] http/wpt/service-workers/push-console-messages-showNotification-sync.https.html [ Pass ]
http/tests/workers/service/shownotification-allowed-document.html [ Pass ]
http/tests/workers/service/shownotification-allowed.html [ Pass ]
http/tests/workers/service/shownotification-invalid-data.html [ Pass ]
http/wpt/push-api/pushEvent.any.serviceworker.html [ Pass ]
imported/w3c/web-platform-tests/notifications/idlharness.https.any.html [ Pass ]
imported/w3c/web-platform-tests/notifications/idlharness.https.any.serviceworker.html [ Pass ]
imported/w3c/web-platform-tests/notifications/idlharness.https.any.worker.html [ Pass ]
http/tests/workers/service/getnotifications-stop.html [ Pass ]
http/tests/workers/service/getnotifications.html [ Pass ]
http/wpt/service-workers/push-console-messages-no-showNotification.https.html [ Pass ]
http/wpt/service-workers/push-console-messages-showNotification-async.https.html [ Pass ]
http/wpt/service-workers/push-console-messages-showNotification-late.https.html [ Pass ]
http/wpt/service-workers/push-console-messages-showNotification-sync.https.html [ Pass ]

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

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

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

# webkit.org/b/283999 REGRESSION(286110@main?): [macOS] http/tests/workers/service/shownotification-allowed.html is a constant failure (flaky in EWS)
[ Ventura+ ] http/tests/workers/service/shownotification-allowed.html [ Failure ]

# webkit.org/b/284113 REGRESSION(287390@main?): [macOS Release] 4x imported/w3c/web-platform-tests/fs tests are flaky (Failure in EWS)
[ Release ] imported/w3c/web-platform-tests/fs/FileSystemBaseHandle-postMessage-Error.https.window.html [ Pass Failure ]
[ Release ] imported/w3c/web-platform-tests/fs/FileSystemFileHandle-getFile.https.any.worker.html [ Pass Failure ]
Expand Down

0 comments on commit 11f3d06

Please sign in to comment.