Title: [252769] trunk/LayoutTests
Revision
252769
Author
[email protected]
Date
2019-11-22 05:28:57 -0800 (Fri, 22 Nov 2019)

Log Message

[ iOS Release ]: Layout Test http/tests/navigation/page-cache-domcache-pending-promise.html is a Flaky Timeout
https://bugs.webkit.org/show_bug.cgi?id=203373
<rdar://problem/56590038>

Reviewed by Youenn Fablet.

I am not able to reproduce the flakiness so this includes speculative fixes and better error handling so
that the test would hopefully fail with a message instead of timing out.

Speculative fixes:
1. If the promise is resolved before we've navigated away, retry it asynchronously.
2. If the promise is rejected before we've navigated away, retry it asynchronously instead of synchronously.
   I believe it is possible to prevent the navigation otherwise, in cases where the promise is rejected
   synchronously.

* http/tests/navigation/page-cache-domcache-pending-promise-expected.txt:
* http/tests/navigation/page-cache-domcache-pending-promise.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (252768 => 252769)


--- trunk/LayoutTests/ChangeLog	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/ChangeLog	2019-11-22 13:28:57 UTC (rev 252769)
@@ -1,3 +1,23 @@
+2019-11-22  Chris Dumez  <[email protected]>
+
+        [ iOS Release ]: Layout Test http/tests/navigation/page-cache-domcache-pending-promise.html is a Flaky Timeout
+        https://bugs.webkit.org/show_bug.cgi?id=203373
+        <rdar://problem/56590038>
+
+        Reviewed by Youenn Fablet.
+
+        I am not able to reproduce the flakiness so this includes speculative fixes and better error handling so
+        that the test would hopefully fail with a message instead of timing out.
+
+        Speculative fixes:
+        1. If the promise is resolved before we've navigated away, retry it asynchronously.
+        2. If the promise is rejected before we've navigated away, retry it asynchronously instead of synchronously.
+           I believe it is possible to prevent the navigation otherwise, in cases where the promise is rejected
+           synchronously.
+
+        * http/tests/navigation/page-cache-domcache-pending-promise-expected.txt:
+        * http/tests/navigation/page-cache-domcache-pending-promise.html:
+
 2019-11-22  Carlos Garcia Campos  <[email protected]>
 
         File input should fire an 'input' event before the 'change' event

Modified: trunk/LayoutTests/TestExpectations (252768 => 252769)


--- trunk/LayoutTests/TestExpectations	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/TestExpectations	2019-11-22 13:28:57 UTC (rev 252769)
@@ -473,7 +473,7 @@
 imported/w3c/web-platform-tests/workers/constructors/SharedWorker [ Skip ]
 imported/w3c/web-platform-tests/workers/SharedWorker_blobUrl.html [ Skip ]
 
-http/tests/navigation/page-cache-domcache-pending-promise.html [ DumpJSConsoleLogInStdErr ]
+http/tests/cache-storage/page-cache-domcache-pending-promise.html [ DumpJSConsoleLogInStdErr ]
 
 imported/w3c/web-platform-tests/beacon/beacon-basic-blob.html [ DumpJSConsoleLogInStdErr ]
 imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-redirect.any.worker.html [ DumpJSConsoleLogInStdErr ]

Copied: trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise-expected.txt (from rev 252768, trunk/LayoutTests/http/tests/navigation/page-cache-domcache-pending-promise-expected.txt) (0 => 252769)


--- trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise-expected.txt	2019-11-22 13:28:57 UTC (rev 252769)
@@ -0,0 +1,14 @@
+Tests that a page with pending DOMCache activity goes into the page cache.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+pageshow - not from cache
+pagehide - entering cache
+pageshow - from cache
+PASS Page was restored from Page Cache
+PASS Cache.add() succeeded after restoring from the cache
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise.html (0 => 252769)


--- trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise.html	2019-11-22 13:28:57 UTC (rev 252769)
@@ -0,0 +1,79 @@
+<!-- webkit-test-runner [ enableBackForwardCache=true ] -->
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+description('Tests that a page with pending DOMCache activity goes into the page cache.');
+jsTestIsAsync = true;
+let restoredFromPageCache = false;
+
+window.addEventListener("pageshow", function(event) {
+    debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
+    if (event.persisted) {
+        testPassed("Page was restored from Page Cache");
+        restoredFromPageCache = true;
+        handle2 = setTimeout(() => {
+            testFailed("Page restored from cache but the promise was not resolved.");
+            finishJSTest();
+        }, 10000);
+    }
+});
+
+function tryCache()
+{
+    cache.add('../navigation/resources/blank.txt').then(() => {
+        if (!restoredFromPageCache) {
+            setTimeout(tryCache, 0);
+            return;
+        }
+        testPassed("Cache.add() succeeded after restoring from the cache");
+        clearTimeout(handle2);
+        finishJSTest();
+    }, (e) => {
+        setTimeout(tryCache, 0);
+    });
+}
+
+window.addEventListener("pagehide", function(event) {
+    debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
+    if (!event.persisted) {
+        testFailed("Page failed to enter the Page Cache");
+        finishJSTest();
+    }
+
+    tryCache();
+});
+
+async function clearExistingCache()
+{
+    try {
+        await self.caches.delete('page-cache-test');
+    } catch (e) {
+    }
+}
+
+_onload_ = () => {
+    clearExistingCache();
+
+    setTimeout(() => {
+        handle1 = setTimeout(() => {
+            testFailed("Timed out while waiting for the cache to open");
+            finishJSTest();
+        }, 10000);
+        caches.open('page-cache-test').then((_cache) => {
+            clearTimeout(handle1);
+            cache = _cache;
+            testLink.click();
+        }, (e) => {
+            testFailed("Failed to open the cache: " + e);
+            finishJSTest();
+        });
+    }, 0);
+}
+</script>
+<a id="testLink" href="" style="display: none">Link</a>
+</body>
+</html>

Copied: trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise-expected.txt (from rev 252768, trunk/LayoutTests/http/tests/navigation/page-cache-domcachestorage-pending-promise-expected.txt) (0 => 252769)


--- trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise-expected.txt	2019-11-22 13:28:57 UTC (rev 252769)
@@ -0,0 +1,15 @@
+Tests that a page with pending DOMCacheStorage activity goes into the page cache.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+pageshow - not from cache
+pagehide - entering cache
+pageshow - from cache
+PASS Page was restored from Page Cache
+PASS Opened the cache
+PASS !!restoredFromPageCache is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html (from rev 252768, trunk/LayoutTests/http/tests/navigation/page-cache-domcachestorage-pending-promise.html) (0 => 252769)


--- trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html	2019-11-22 13:28:57 UTC (rev 252769)
@@ -0,0 +1,46 @@
+<!-- webkit-test-runner [ enableBackForwardCache=true ] -->
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+description('Tests that a page with pending DOMCacheStorage activity goes into the page cache.');
+jsTestIsAsync = true;
+let restoredFromPageCache = false;
+
+window.addEventListener("pageshow", function(event) {
+    debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
+    if (event.persisted) {
+        testPassed("Page was restored from Page Cache");
+        restoredFromPageCache = true;
+    }
+});
+
+window.addEventListener("pagehide", function(event) {
+    debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
+    if (!event.persisted) {
+        testFailed("Page failed to enter the Page Cache");
+        finishJSTest();
+    }
+
+    caches.open('test').then(() => {
+       testPassed("Opened the cache");
+       shouldBeTrue("!!restoredFromPageCache");
+       finishJSTest();
+    }, () => {
+       testFailed("Failed to open the cache");
+       finishJSTest();
+    });
+});
+
+_onload_ = () => {
+    setTimeout(() => {
+        testLink.click();
+    }, 0);
+}
+</script>
+<a id="testLink" href="" style="display: none">Link</a>
+</body>
+</html>

Deleted: trunk/LayoutTests/http/tests/navigation/page-cache-domcache-pending-promise-expected.txt (252768 => 252769)


--- trunk/LayoutTests/http/tests/navigation/page-cache-domcache-pending-promise-expected.txt	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-domcache-pending-promise-expected.txt	2019-11-22 13:28:57 UTC (rev 252769)
@@ -1,15 +0,0 @@
-Tests that a page with pending DOMCache activity goes into the page cache.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-pageshow - not from cache
-pagehide - entering cache
-pageshow - from cache
-PASS Page was restored from Page Cache
-PASS Cache.add() succeeded
-PASS !!restoredFromPageCache is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/http/tests/navigation/page-cache-domcache-pending-promise.html (252768 => 252769)


--- trunk/LayoutTests/http/tests/navigation/page-cache-domcache-pending-promise.html	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-domcache-pending-promise.html	2019-11-22 13:28:57 UTC (rev 252769)
@@ -1,53 +0,0 @@
-<!-- webkit-test-runner [ enableBackForwardCache=true ] -->
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<script>
-description('Tests that a page with pending DOMCache activity goes into the page cache.');
-jsTestIsAsync = true;
-let restoredFromPageCache = false;
-
-window.addEventListener("pageshow", function(event) {
-    debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
-    if (event.persisted) {
-        testPassed("Page was restored from Page Cache");
-        restoredFromPageCache = true;
-    }
-});
-
-function tryCache()
-{
-    cache.add('resources/blank.txt').then(() => {
-        testPassed("Cache.add() succeeded");
-        shouldBeTrue("!!restoredFromPageCache");
-        finishJSTest();
-    }, (e) => {
-        tryCache();
-    });
-}
-
-window.addEventListener("pagehide", function(event) {
-    debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
-    if (!event.persisted) {
-        testFailed("Page failed to enter the Page Cache");
-        finishJSTest();
-    }
-
-    tryCache();
-});
-
-_onload_ = () => {
-    setTimeout(() => {
-        caches.open('test').then((_cache) => {
-            cache = _cache;
-            testLink.click();
-        });
-    }, 0);
-}
-</script>
-<a id="testLink" href="" style="display: none">Link</a>
-</body>
-</html>

Deleted: trunk/LayoutTests/http/tests/navigation/page-cache-domcachestorage-pending-promise-expected.txt (252768 => 252769)


--- trunk/LayoutTests/http/tests/navigation/page-cache-domcachestorage-pending-promise-expected.txt	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-domcachestorage-pending-promise-expected.txt	2019-11-22 13:28:57 UTC (rev 252769)
@@ -1,15 +0,0 @@
-Tests that a page with pending DOMCacheStorage activity goes into the page cache.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-pageshow - not from cache
-pagehide - entering cache
-pageshow - from cache
-PASS Page was restored from Page Cache
-PASS Opened the cache
-PASS !!restoredFromPageCache is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/http/tests/navigation/page-cache-domcachestorage-pending-promise.html (252768 => 252769)


--- trunk/LayoutTests/http/tests/navigation/page-cache-domcachestorage-pending-promise.html	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-domcachestorage-pending-promise.html	2019-11-22 13:28:57 UTC (rev 252769)
@@ -1,46 +0,0 @@
-<!-- webkit-test-runner [ enableBackForwardCache=true ] -->
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<script>
-description('Tests that a page with pending DOMCacheStorage activity goes into the page cache.');
-jsTestIsAsync = true;
-let restoredFromPageCache = false;
-
-window.addEventListener("pageshow", function(event) {
-    debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
-    if (event.persisted) {
-        testPassed("Page was restored from Page Cache");
-        restoredFromPageCache = true;
-    }
-});
-
-window.addEventListener("pagehide", function(event) {
-    debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
-    if (!event.persisted) {
-        testFailed("Page failed to enter the Page Cache");
-        finishJSTest();
-    }
-
-    caches.open('test').then(() => {
-       testPassed("Opened the cache");
-       shouldBeTrue("!!restoredFromPageCache");
-       finishJSTest();
-    }, () => {
-       testFailed("Failed to open the cache");
-       finishJSTest();
-    });
-});
-
-_onload_ = () => {
-    setTimeout(() => {
-        testLink.click();
-    }, 0);
-}
-</script>
-<a id="testLink" href="" style="display: none">Link</a>
-</body>
-</html>

Modified: trunk/LayoutTests/platform/ios-wk1/TestExpectations (252768 => 252769)


--- trunk/LayoutTests/platform/ios-wk1/TestExpectations	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/platform/ios-wk1/TestExpectations	2019-11-22 13:28:57 UTC (rev 252769)
@@ -11,8 +11,6 @@
 http/wpt/service-workers [ Skip ]
 http/wpt/cache-storage [ Skip ]
 http/tests/cache-storage [ Skip ]
-http/tests/navigation/page-cache-domcache-pending-promise.html [ Skip ]
-http/tests/navigation/page-cache-domcachestorage-pending-promise.html [ Skip ]
 imported/w3c/web-platform-tests/fetch/api/request/destination [ Skip ]
 imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy [ Skip ]
 

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (252768 => 252769)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-11-22 13:28:57 UTC (rev 252769)
@@ -276,8 +276,6 @@
 # No service worker implementation for WK1
 http/tests/appcache/main-resource-redirect-with-sw.html [ Skip ]
 http/tests/cache-storage [ Skip ]
-http/tests/navigation/page-cache-domcache-pending-promise.html [ Skip ]
-http/tests/navigation/page-cache-domcachestorage-pending-promise.html [ Skip ]
 http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html [ Skip ]
 http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html [ Skip ]
 http/wpt/cache-storage [ Skip ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (252768 => 252769)


--- trunk/LayoutTests/platform/win/TestExpectations	2019-11-22 13:09:29 UTC (rev 252768)
+++ trunk/LayoutTests/platform/win/TestExpectations	2019-11-22 13:28:57 UTC (rev 252769)
@@ -3804,8 +3804,6 @@
 # No service worker implementation for WK1
 http/tests/appcache/main-resource-redirect-with-sw.html [ Skip ]
 http/tests/cache-storage [ Skip ]
-http/tests/navigation/page-cache-domcache-pending-promise.html [ Skip ]
-http/tests/navigation/page-cache-domcachestorage-pending-promise.html [ Skip ]
 http/tests/inspector/network/resource-response-service-worker.html [ Skip ]
 http/tests/workers/service [ Skip ]
 http/wpt/cache-storage [ Skip ]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to