Bug 1483180 [wpt PR 12474] - Deflake timeout-multiple-fetches.html, a=testonly
authorAdam Rice <ricea@chromium.org>
Sat, 01 Sep 2018 00:39:58 +0000
changeset 482788 4c7dca89ec35d0b244107fdeef12d1d4ca4c6e05
parent 482787 972ff5712d4ed980c6d1fb5bda21e30e00ed3371
child 482789 e905197a76c882faadeef4c63064611c4d476e79
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewerstestonly
bugs1483180, 12474, 871578, 1174209, 586610
milestone63.0a1
Bug 1483180 [wpt PR 12474] - Deflake timeout-multiple-fetches.html, a=testonly Automatic update from web-platform-testsDeflake timeout-multiple-fetches.html The external/wpt/xhr/timeout-multiple-fetches.html layout test was flaky due to a race condition. Adjust the timeout to improve the probability of the right side winning the race. Also add a uuid to the URL to stop preflight caching from breaking the test. BUG=871578 Change-Id: I76056f7dadc789289755c35f6b6b9d8ae86c1441 Reviewed-on: https://chromium-review.googlesource.com/1174209 Commit-Queue: Adam Rice <ricea@chromium.org> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#586610} -- wpt-commits: e6116f91471b4b5eb7fa3de7bd693018e418bb54 wpt-pr: 12474
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/xhr/timeout-multiple-fetches.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -659875,17 +659875,17 @@
    "c23c99788e46dae24009b3c5092efeb5f93b8e1f",
    "testharness"
   ],
   "xhr/timeout-cors-async.htm": [
    "35e2a30ba2f51aaa6b3ba21603869db156decd5b",
    "testharness"
   ],
   "xhr/timeout-multiple-fetches.html": [
-   "30d6b736c56d5576483c12a7413dd809d27d89e8",
+   "4f4998c4285222bf4bdf41c3e0c1c27e913d2149",
    "testharness"
   ],
   "xhr/timeout-sync.htm": [
    "9815532c70ff347199a998f02bf4b11f15c7bcee",
    "testharness"
   ],
   "xhr/xmlhttprequest-basic.htm": [
    "c48b610ff6627af704810740a2dcab23d085764b",
--- a/testing/web-platform/tests/xhr/timeout-multiple-fetches.html
+++ b/testing/web-platform/tests/xhr/timeout-multiple-fetches.html
@@ -1,29 +1,32 @@
 <!doctype html>
 <title>XMLHttpRequest: timeout, redirects, and CORS preflights</title>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <script src=/common/get-host-info.sub.js></script>
+<script src=/common/utils.js></script>
 <div id=log></div>
 <script>
 async_test(t => {
   const client = new XMLHttpRequest
   client.open("GET", "resources/redirect.py?delay=500&location=delay.py") // 500 + 500 = 1000
-  client.timeout = 1000
+  client.timeout = 750
   client.send()
   client.ontimeout = t.step_func_done(() => {
     assert_equals(client.readyState, 4)
   })
   client.onload = t.unreached_func("load event fired")
 }, "Redirects should not reset the timer")
 
 async_test(t => {
+  // Use a unique ID to prevent caching of the preflight making the test flaky.
+  const uuid = token();
   const client = new XMLHttpRequest
-  client.open("YO", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/delay.py")
-  client.timeout = 1000
+  client.open("YO", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/delay.py?uuid=" + uuid)
+  client.timeout = 750
   client.send()
   client.ontimeout = t.step_func_done(() => {
     assert_equals(client.readyState, 4)
   })
   client.onload = t.unreached_func("load event fired")
 }, "CORS preflights should not reset the timer")
 </script>