Bug 1382456 - Intermittent failure in browser_raceWithTabs.js. r=Standard8
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 08 Mar 2019 11:57:35 +0000
changeset 463145 33c69b500eedc3d30b612887b5e271d11a7a7d6a
parent 463144 75033c11fa3c9f10f2697badbf7c0887a5fd7e5b
child 463146 fa25d5068254d154157c605f572a7121d7ff995e
push id35668
push userbtara@mozilla.com
push dateFri, 08 Mar 2019 21:50:53 +0000
treeherdermozilla-central@14778fd00dc5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1382456
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1382456 - Intermittent failure in browser_raceWithTabs.js. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D22531
browser/components/urlbar/tests/browser/browser.ini
browser/components/urlbar/tests/browser/browser_raceWithTabs.js
browser/components/urlbar/tests/legacy/browser.ini
--- a/browser/components/urlbar/tests/browser/browser.ini
+++ b/browser/components/urlbar/tests/browser/browser.ini
@@ -45,24 +45,23 @@ support-files =
 [browser_moz_action_link.js]
 [browser_new_tab_urlbar_reset.js]
 [browser_pasteAndGo.js]
 subsuite = clipboard
 [browser_populateAfterPushState.js]
 [browser_privateBrowsingWindowChange.js]
 skip-if = debug # Bug 1532034 - Leaks in debug mode.
 [browser_raceWithTabs.js]
-skip-if = os == "linux" # Bug 1382456
 [browser_redirect_error.js]
 support-files = redirect_error.sjs
 [browser_remotetab.js]
 [browser_removeUnsafeProtocolsFromURLBarPaste.js]
 subsuite = clipboard
 [browser_search_favicon.js]
-skip-if = true # Bug 1526222 - Doesn't currently work with QuantumBar
+skip-if = true # Bug 1526222 - Doesn't currently work with QuantumBar
 [browser_searchTelemetry.js]
 support-files =
   searchSuggestionEngine.xml
   searchSuggestionEngine.sjs
 [browser_stop_pending.js]
 support-files =
   slow-page.sjs
 [browser_switchTab_closesUrlbarPopup.js]
--- a/browser/components/urlbar/tests/browser/browser_raceWithTabs.js
+++ b/browser/components/urlbar/tests/browser/browser_raceWithTabs.js
@@ -36,37 +36,40 @@ add_task(async function hitEnterLoadInRi
     keyword: "urlbarkeyword",
   });
 
   info("Opening a tab");
   let oldTabOpenPromise = BrowserTestUtils.waitForEvent(gBrowser.tabContainer,
                                                         "TabOpen");
   BrowserOpenTab();
   let oldTab = (await oldTabOpenPromise).target;
-  let oldTabLoadedPromise = BrowserTestUtils.browserLoaded(oldTab.linkedBrowser,
-                                                           false, TEST_URL);
-  oldTabLoadedPromise.then(() => info("Old tab loaded"));
+  let oldTabLoadedPromise =
+    BrowserTestUtils.browserLoaded(oldTab.linkedBrowser, false, TEST_URL)
+                    .then(() => info("Old tab loaded"));
 
   info("Filling URL bar, sending <return> and opening a tab");
   let tabOpenPromise = BrowserTestUtils.waitForEvent(gBrowser.tabContainer,
                                                      "TabOpen");
   gURLBar.value = "urlbarkeyword";
   gURLBar.focus();
   gURLBar.select();
   EventUtils.sendKey("return");
 
   info("Immediately open a second tab");
   BrowserOpenTab();
   let newTab = (await tabOpenPromise).target;
 
-  info("Created new tab; waiting for either tab to load");
-  let newTabLoadedPromise = BrowserTestUtils.browserLoaded(newTab.linkedBrowser,
-                                                           false, TEST_URL);
-  newTabLoadedPromise.then(() => info("New tab loaded"));
-  await Promise.race([newTabLoadedPromise, oldTabLoadedPromise]);
+  info("Created new tab; waiting for tabs to load");
+  let newTabLoadedPromise =
+    BrowserTestUtils.browserLoaded(newTab.linkedBrowser, false, "about:newtab")
+                    .then(() => info("New tab loaded"));
+  // If one of the tabs loads the wrong page, this will timeout, and that
+  // indicates we regressed this bug fix.
+  await Promise.all([newTabLoadedPromise, oldTabLoadedPromise]);
+  // These are not particularly useful, but the test must contain some checks.
   is(newTab.linkedBrowser.currentURI.spec, "about:newtab",
-                                           "New tab still has about:newtab");
+     "New tab loaded about:newtab");
   is(oldTab.linkedBrowser.currentURI.spec, TEST_URL, "Old tab loaded URL");
 
   info("Closing tabs");
   BrowserTestUtils.removeTab(newTab);
   BrowserTestUtils.removeTab(oldTab);
 });
--- a/browser/components/urlbar/tests/legacy/browser.ini
+++ b/browser/components/urlbar/tests/legacy/browser.ini
@@ -68,17 +68,16 @@ skip-if = (os == "linux" || os == "mac")
 [../browser/browser_locationBarExternalLoad.js]
 [../browser/browser_moz_action_link.js]
 [../browser/browser_new_tab_urlbar_reset.js]
 [../browser/browser_pasteAndGo.js]
 subsuite = clipboard
 [../browser/browser_populateAfterPushState.js]
 [../browser/browser_privateBrowsingWindowChange.js]
 [../browser/browser_raceWithTabs.js]
-skip-if = os == "linux" # Bug 1382456
 [../browser/browser_redirect_error.js]
 support-files = ../browser/redirect_error.sjs
 [../browser/browser_remotetab.js]
 [../browser/browser_removeUnsafeProtocolsFromURLBarPaste.js]
 subsuite = clipboard
 [../browser/browser_search_favicon.js]
 [../browser/browser_searchTelemetry.js]
 support-files =