REGRESSION: [ Mac wk2 ] imported/w3c/web-platform-tests/service-workers/service-worke...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2019 23:33:20 +0000 (23:33 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2019 23:33:20 +0000 (23:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205286
<rdar://problem/57976344>

Reviewed by Alexey Proskuryakov.

The test triggers a registration update and then expects registration.installing to be non-null
once the registration update promise is resolved. This is only true if the content of the service
worker script is different since last update. The script included a timestamp to try and make
the script different every time but it would sometimes not suffice if the update happens quickly
enough. To address the issue, include a UUID in the script instead of a timestamp.

Upstream PR: https://github.com/web-platform-tests/wpt/pull/20797

* web-platform-tests/service-workers/service-worker/resources/test-request-headers-worker.js:
* web-platform-tests/service-workers/service-worker/resources/test-request-headers-worker.py:
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253592 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-headers-worker.js
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-headers-worker.py

index ff86a69..96dc0c6 100644 (file)
@@ -1,3 +1,23 @@
+2019-12-16  Chris Dumez  <cdumez@apple.com>
+
+        REGRESSION: [ Mac wk2 ] imported/w3c/web-platform-tests/service-workers/service-worker/update-no-cache-request-headers.https.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=205286
+        <rdar://problem/57976344>
+
+        Reviewed by Alexey Proskuryakov.
+
+        The test triggers a registration update and then expects registration.installing to be non-null
+        once the registration update promise is resolved. This is only true if the content of the service
+        worker script is different since last update. The script included a timestamp to try and make
+        the script different every time but it would sometimes not suffice if the update happens quickly
+        enough. To address the issue, include a UUID in the script instead of a timestamp.
+
+        Upstream PR: https://github.com/web-platform-tests/wpt/pull/20797
+
+        * web-platform-tests/service-workers/service-worker/resources/test-request-headers-worker.js:
+        * web-platform-tests/service-workers/service-worker/resources/test-request-headers-worker.py:
+        (main):
+
 2019-12-13  Chris Dumez  <cdumez@apple.com>
 
         Implement PostMessageOptions for postMessage
index 8d47591..566e2e9 100644 (file)
@@ -1,5 +1,5 @@
-// Add a unique timestamp per request to induce service worker script update.
-// Time stamp: %TIMESTAMP%
+// Add a unique UUID per request to induce service worker script update.
+// Time stamp: %UUID%
 
 // The server injects the request headers here as a JSON string.
 const headersAsJson = `%HEADERS%`;
index d305705..b128a2a 100644 (file)
@@ -1,6 +1,6 @@
 import json
 import os
-import time
+import uuid
 
 def main(request, response):
   path = os.path.join(os.path.dirname(__file__),
@@ -9,7 +9,7 @@ def main(request, response):
 
   data = {key:request.headers[key] for key,value in request.headers.iteritems()}
   body = body.replace("%HEADERS%", json.dumps(data))
-  body = body.replace("%TIMESTAMP%", str(time.time()))
+  body = body.replace("%UUID%", str(uuid.uuid4()))
 
   headers = []
   headers.append(("ETag", "etag"))