WebKit Bugzilla
Attachment 357173 Details for
Bug 191207
: REGRESSION: [ MacOS iOS ] Layout Test http/wpt/resource-timing/rt-revalidate-requests.html is flaky timeout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Proposed Fix
layout-tests-1.patch (text/plain), 18.17 KB, created by
Joseph Pecoraro
on 2018-12-12 15:11:52 PST
(
hide
)
Description:
[PATCH] Proposed Fix
Filename:
MIME Type:
Creator:
Joseph Pecoraro
Created:
2018-12-12 15:11:52 PST
Size:
18.17 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 32fb346d6b7..a81907db72c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,30 @@ >+2018-12-12 Joseph Pecoraro <pecoraro@apple.com> >+ >+ REGRESSION: [ MacOS iOS ] Layout Test http/wpt/resource-timing/rt-revalidate-requests.html is flaky timeout >+ https://bugs.webkit.org/show_bug.cgi?id=191207 >+ <rdar://problem/45818891> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Splitting this test up into separate tests eliminated flakiness >+ and timeouts for my system that would occasionally encounter them. >+ >+ * TestExpectations: >+ Remove expectation for the test now that splitting up eliminated flakiness so far. >+ >+ * http/wpt/resource-timing/resources/rt-revalidate-utilities.sub.js >+ Common code for the split out tests. >+ >+ * http/wpt/resource-timing/rt-revalidate-requests-1-expected.txt: Added. >+ * http/wpt/resource-timing/rt-revalidate-requests-1.html: Added. >+ * http/wpt/resource-timing/rt-revalidate-requests-2-expected.txt: Added. >+ * http/wpt/resource-timing/rt-revalidate-requests-2.html: Added. >+ * http/wpt/resource-timing/rt-revalidate-requests-3-expected.txt: Added. >+ * http/wpt/resource-timing/rt-revalidate-requests-3.html: Added. >+ * http/wpt/resource-timing/rt-revalidate-requests.html: Removed. >+ * http/wpt/resource-timing/rt-revalidate-requests-expected.txt: Removed. >+ Split out into separate tests. >+ > 2018-12-10 Rob Buis <rbuis@igalia.com> > > XMLHttpRequest removes spaces from content-types before processing >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index a9f6d97d68f..d75b0e97913 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -761,7 +761,6 @@ imported/w3c/web-platform-tests/resource-timing/test_resource_timing.html [ Pass > webkit.org/b/168357 http/wpt/resource-timing/rt-initiatorType-media.html [ Failure ] > webkit.org/b/168448 http/wpt/resource-timing/rt-shared-resource-in-frames.html [ Pass Failure ] > webkit.org/b/168448 http/wpt/resource-timing/rt-shared-resource-in-workers.html [ Pass Failure ] >-webkit.org/b/171511 http/wpt/resource-timing/rt-revalidate-requests.html [ Pass Failure ] > > webkit.org/b/161312 imported/w3c/web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context.html [ Failure Pass ] > >diff --git a/LayoutTests/http/wpt/resource-timing/resources/rt-revalidate-utilities.sub.js b/LayoutTests/http/wpt/resource-timing/resources/rt-revalidate-utilities.sub.js >new file mode 100644 >index 00000000000..30d576d830f >--- /dev/null >+++ b/LayoutTests/http/wpt/resource-timing/resources/rt-revalidate-utilities.sub.js >@@ -0,0 +1,60 @@ >+function createRevalidationURL({tao, crossOrigin}) { >+ let token = Math.random(); >+ let content = encodeURIComponent("var revalidationTest = 1;"); >+ let mimeType = encodeURIComponent("text/javascript"); >+ let date = encodeURIComponent(new Date(2000, 1, 1).toGMTString()); >+ let params = `content=${content}&mimeType=${mimeType}&date=${date}&tao=${tao ? true : false}`; >+ >+ const path = "WebKit/resource-timing/resources/rt-revalidation-response.py"; >+ if (crossOrigin) >+ return crossOriginURL(`${token}&${params}`, path); >+ return location.origin + `/${path}?${token}&${params}`; >+} >+ >+function makeRequest(url, revalidation = false) { >+ let xhr = new XMLHttpRequest; >+ xhr.open("GET", url, true); >+ if (revalidation) >+ xhr.setRequestHeader("If-Modified-Since", new Date().toGMTString()); >+ xhr.send(); >+} >+ >+function assertAlways(entry) { >+ assert_equals(entry.workerStart, 0, "entry should not have a workerStart time"); >+ assert_equals(entry.secureConnectionStart, 0, "entry should not have a secureConnectionStart time"); >+ >+ assert_not_equals(entry.startTime, 0, "entry should have a non-0 fetchStart time"); >+ assert_not_equals(entry.fetchStart, 0, "entry should have a non-0 startTime time"); >+ assert_not_equals(entry.responseEnd, 0, "entry should have a non-0 responseEnd time"); >+ >+ assert_greater_than_equal(entry.fetchStart, entry.startTime, "fetchStart after startTime"); >+ assert_greater_than_equal(entry.responseEnd, entry.fetchStart, "responseEnd after fetchStart"); >+} >+ >+function assertAllowedTimingData(entry) { >+ assert_greater_than_equal(entry.domainLookupStart || entry.fetchStart, entry.fetchStart, "domainLookupStart after fetchStart"); >+ assert_greater_than_equal(entry.domainLookupEnd || entry.fetchStart, entry.domainLookupStart, "domainLookupEnd after domainLookupStart"); >+ assert_greater_than_equal(entry.connectStart || entry.fetchStart, entry.domainLookupEnd, "connectStart after domainLookupEnd"); >+ assert_greater_than_equal(entry.connectEnd || entry.fetchStart, entry.connectStart, "connectEnd after connectStart"); >+ assert_greater_than_equal(entry.requestStart || entry.fetchStart, entry.connectEnd, "requestStart after connectEnd"); >+ assert_greater_than_equal(entry.responseStart || entry.fetchStart, entry.requestStart, "responseStart after requestStart"); >+ assert_greater_than_equal(entry.responseEnd || entry.fetchStart, entry.responseStart, "responseEnd after responseStart"); >+} >+ >+function assertDisallowedTimingData(entry) { >+ // These attributes must be zero: >+ // https://w3c.github.io/resource-timing/#cross-origin-resources >+ const keys = [ >+ "redirectStart", >+ "redirectEnd", >+ "domainLookupStart", >+ "domainLookupEnd", >+ "connectStart", >+ "connectEnd", >+ "requestStart", >+ "responseStart", >+ "secureConnectionStart", >+ ]; >+ for (let key of keys) >+ assert_equals(entry[key], 0, `entry ${key} must be zero for Cross Origin resource without passing Timing-Allow-Origin check`); >+} >diff --git a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-1-expected.txt b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-1-expected.txt >new file mode 100644 >index 00000000000..7402236e279 >--- /dev/null >+++ b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-1-expected.txt >@@ -0,0 +1,6 @@ >+Resource Timing: ResourceTiming for revalidation requests >+ >+ >+PASS Same Origin network load >+PASS Same Origin revalidation load >+ >diff --git a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-1.html b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-1.html >new file mode 100644 >index 00000000000..487fc1d99fb >--- /dev/null >+++ b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-1.html >@@ -0,0 +1,38 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>Resource Timing - ResourceTiming for revalidation requests</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/rt-utilities.sub.js"></script> >+<script src="resources/rt-revalidate-utilities.sub.js"></script> >+</head> >+<body> >+<h1>Resource Timing: ResourceTiming for revalidation requests</h1> >+<div id="log"></div> >+<script> >+// Same Origin (revalidation request). >+ >+let sameOriginURL = createRevalidationURL({tao: true, crossOrigin: false}); >+ >+promise_test(function(t) { >+ let promise = observeResources(1).then(([entry]) => { >+ assertAlways(entry); >+ assertAllowedTimingData(entry); >+ }); >+ makeRequest(sameOriginURL); >+ return promise; >+}, "Same Origin network load"); >+ >+promise_test(function(t) { >+ let promise = observeResources(1).then(([entry]) => { >+ assertAlways(entry); >+ assertAllowedTimingData(entry); >+ }); >+ makeRequest(sameOriginURL, true); >+ return promise; >+}, "Same Origin revalidation load"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-2-expected.txt b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-2-expected.txt >new file mode 100644 >index 00000000000..62544be33a6 >--- /dev/null >+++ b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-2-expected.txt >@@ -0,0 +1,6 @@ >+Resource Timing: ResourceTiming for revalidation requests >+ >+ >+PASS Cross Origin network load (no TimingAllow) >+PASS Cross Origin revalidation load (no TimingAllow) >+ >diff --git a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-2.html b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-2.html >new file mode 100644 >index 00000000000..4fbd6176e33 >--- /dev/null >+++ b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-2.html >@@ -0,0 +1,38 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>Resource Timing - ResourceTiming for revalidation requests</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/rt-utilities.sub.js"></script> >+<script src="resources/rt-revalidate-utilities.sub.js"></script> >+</head> >+<body> >+<h1>Resource Timing: ResourceTiming for revalidation requests</h1> >+<div id="log"></div> >+<script> >+// Cross Origin (revalidation request) without Timing Allow. >+ >+let crossOriginURLNoTao = createRevalidationURL({tao: false, crossOrigin: true}); >+ >+promise_test(function(t) { >+ let promise = observeResources(1).then(([entry]) => { >+ assertAlways(entry); >+ assertDisallowedTimingData(entry); >+ }); >+ makeRequest(crossOriginURLNoTao); >+ return promise; >+}, "Cross Origin network load (no TimingAllow)"); >+ >+promise_test(function(t) { >+ let promise = observeResources(1).then(([entry]) => { >+ assertAlways(entry); >+ assertDisallowedTimingData(entry); >+ }); >+ makeRequest(crossOriginURLNoTao, true); >+ return promise; >+}, "Cross Origin revalidation load (no TimingAllow)"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-3-expected.txt b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-3-expected.txt >new file mode 100644 >index 00000000000..744c43f1cd4 >--- /dev/null >+++ b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-3-expected.txt >@@ -0,0 +1,6 @@ >+Resource Timing: ResourceTiming for revalidation requests >+ >+ >+PASS Cross Origin network load (with TimingAllow) >+PASS Cross Origin revalidation load (with TimingAllow) >+ >diff --git a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-3.html b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-3.html >new file mode 100644 >index 00000000000..c881b4930e8 >--- /dev/null >+++ b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-3.html >@@ -0,0 +1,38 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>Resource Timing - ResourceTiming for revalidation requests</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<script src="resources/rt-utilities.sub.js"></script> >+<script src="resources/rt-revalidate-utilities.sub.js"></script> >+</head> >+<body> >+<h1>Resource Timing: ResourceTiming for revalidation requests</h1> >+<div id="log"></div> >+<script> >+// Cross Origin (revalidation request) with Timing Allow. >+ >+let crossOriginURLWithTao = createRevalidationURL({tao: true, crossOrigin: true}); >+ >+promise_test(function(t) { >+ let promise = observeResources(1).then(([entry]) => { >+ assertAlways(entry); >+ assertAllowedTimingData(entry); >+ }); >+ makeRequest(crossOriginURLWithTao); >+ return promise; >+}, "Cross Origin network load (with TimingAllow)"); >+ >+promise_test(function(t) { >+ let promise = observeResources(1).then(([entry]) => { >+ assertAlways(entry); >+ assertAllowedTimingData(entry); >+ }); >+ makeRequest(crossOriginURLWithTao, true); >+ return promise; >+}, "Cross Origin revalidation load (with TimingAllow)"); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-expected.txt b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-expected.txt >deleted file mode 100644 >index d9b42c1cfa7..00000000000 >--- a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests-expected.txt >+++ /dev/null >@@ -1,10 +0,0 @@ >-Resource Timing: ResourceTiming for revalidation requests >- >- >-PASS Same Origin network load >-PASS Same Origin revalidation load >-PASS Cross Origin network load (no TimingAllow) >-PASS Cross Origin revalidation load (no TimingAllow) >-PASS Cross Origin network load (with TimingAllow) >-PASS Cross Origin revalidation load (with TimingAllow) >- >diff --git a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests.html b/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests.html >deleted file mode 100644 >index 51a8083f559..00000000000 >--- a/LayoutTests/http/wpt/resource-timing/rt-revalidate-requests.html >+++ /dev/null >@@ -1,143 +0,0 @@ >-<!DOCTYPE html> >-<html> >-<head> >-<meta charset="utf-8"> >-<title>Resource Timing - ResourceTiming for revalidation requests</title> >-<script src="/resources/testharness.js"></script> >-<script src="/resources/testharnessreport.js"></script> >-<script src="resources/rt-utilities.sub.js"></script> >-</head> >-<body> >-<h1>Resource Timing: ResourceTiming for revalidation requests</h1> >-<div id="log"></div> >-<script> >-const IncludeTimingOriginAllowHeaders = { Yes: true, No: false }; >-function createRevalidationURL({tao, crossOrigin}) { >- let token = Math.random(); >- let content = encodeURIComponent("var revalidationTest = 1;"); >- let mimeType = encodeURIComponent("text/javascript"); >- let date = encodeURIComponent(new Date(2000, 1, 1).toGMTString()); >- let params = `content=${content}&mimeType=${mimeType}&date=${date}&tao=${tao ? true : false}`; >- >- const path = "WebKit/resource-timing/resources/rt-revalidation-response.py"; >- if (crossOrigin) >- return crossOriginURL(`${token}&${params}`, path); >- return location.origin + `/${path}?${token}&${params}`; >-} >- >-function makeRequest(url, revalidation = false) { >- let xhr = new XMLHttpRequest; >- xhr.open("GET", url, true); >- if (revalidation) >- xhr.setRequestHeader("If-Modified-Since", new Date().toGMTString()); >- xhr.send(); >-} >- >-function assertAlways(entry) { >- assert_equals(entry.workerStart, 0, "entry should not have a workerStart time"); >- assert_equals(entry.secureConnectionStart, 0, "entry should not have a secureConnectionStart time"); >- >- assert_not_equals(entry.startTime, 0, "entry should have a non-0 fetchStart time"); >- assert_not_equals(entry.fetchStart, 0, "entry should have a non-0 startTime time"); >- assert_not_equals(entry.responseEnd, 0, "entry should have a non-0 responseEnd time"); >- >- assert_greater_than_equal(entry.fetchStart, entry.startTime, "fetchStart after startTime"); >- assert_greater_than_equal(entry.responseEnd, entry.fetchStart, "responseEnd after fetchStart"); >-} >- >-function assertAllowedTimingData(entry) { >- assert_greater_than_equal(entry.domainLookupStart || entry.fetchStart, entry.fetchStart, "domainLookupStart after fetchStart"); >- assert_greater_than_equal(entry.domainLookupEnd || entry.fetchStart, entry.domainLookupStart, "domainLookupEnd after domainLookupStart"); >- assert_greater_than_equal(entry.connectStart || entry.fetchStart, entry.domainLookupEnd, "connectStart after domainLookupEnd"); >- assert_greater_than_equal(entry.connectEnd || entry.fetchStart, entry.connectStart, "connectEnd after connectStart"); >- assert_greater_than_equal(entry.requestStart || entry.fetchStart, entry.connectEnd, "requestStart after connectEnd"); >- assert_greater_than_equal(entry.responseStart || entry.fetchStart, entry.requestStart, "responseStart after requestStart"); >- assert_greater_than_equal(entry.responseEnd || entry.fetchStart, entry.responseStart, "responseEnd after responseStart"); >-} >- >-function assertDisallowedTimingData(entry) { >- // These attributes must be zero: >- // https://w3c.github.io/resource-timing/#cross-origin-resources >- const keys = [ >- "redirectStart", >- "redirectEnd", >- "domainLookupStart", >- "domainLookupEnd", >- "connectStart", >- "connectEnd", >- "requestStart", >- "responseStart", >- "secureConnectionStart", >- ]; >- for (let key of keys) >- assert_equals(entry[key], 0, `entry ${key} must be zero for Cross Origin resource without passing Timing-Allow-Origin check`); >-} >- >-// Same Origin (revalidation request). >- >-let sameOriginURL = createRevalidationURL({tao: true, crossOrigin: false}); >- >-promise_test(function(t) { >- let promise = observeResources(1).then(([entry]) => { >- assertAlways(entry); >- assertAllowedTimingData(entry); >- }); >- makeRequest(sameOriginURL); >- return promise; >-}, "Same Origin network load"); >- >-promise_test(function(t) { >- let promise = observeResources(1).then(([entry]) => { >- assertAlways(entry); >- assertAllowedTimingData(entry); >- }); >- makeRequest(sameOriginURL, true); >- return promise; >-}, "Same Origin revalidation load"); >- >-// Cross Origin (revalidation request) without Timing Allow. >- >-let crossOriginURLNoTao = createRevalidationURL({tao: false, crossOrigin: true}); >- >-promise_test(function(t) { >- let promise = observeResources(1).then(([entry]) => { >- assertAlways(entry); >- assertDisallowedTimingData(entry); >- }); >- makeRequest(crossOriginURLNoTao); >- return promise; >-}, "Cross Origin network load (no TimingAllow)"); >- >-promise_test(function(t) { >- let promise = observeResources(1).then(([entry]) => { >- assertAlways(entry); >- assertDisallowedTimingData(entry); >- }); >- makeRequest(crossOriginURLNoTao, true); >- return promise; >-}, "Cross Origin revalidation load (no TimingAllow)"); >- >-// Cross Origin (revalidation request) with Timing Allow. >- >-let crossOriginURLWithTao = createRevalidationURL({tao: true, crossOrigin: true}); >- >-promise_test(function(t) { >- let promise = observeResources(1).then(([entry]) => { >- assertAlways(entry); >- assertAllowedTimingData(entry); >- }); >- makeRequest(crossOriginURLWithTao); >- return promise; >-}, "Cross Origin network load (with TimingAllow)"); >- >-promise_test(function(t) { >- let promise = observeResources(1).then(([entry]) => { >- assertAlways(entry); >- assertAllowedTimingData(entry); >- }); >- makeRequest(crossOriginURLWithTao, true); >- return promise; >-}, "Cross Origin revalidation load (with TimingAllow)"); >-</script> >-</body> >-</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191207
: 357173