Bug 1087120 - Fix intermittent browser_ContentSearch.js failure by increasing timeout for remote search suggestions. r=MattN
authorDrew Willcoxon <adw@mozilla.com>
Fri, 31 Oct 2014 15:07:59 -0700
changeset 213521 1ec8dbde7cf8772038f4719fda34c1ad7029cd31
parent 213520 78421574587d0ca93f14b6ca10e4b2e4de1a0015
child 213522 2d7b325be9afa143578ebf0c2b709557ccc32dea
push id27754
push userphilringnalda@gmail.com
push dateSun, 02 Nov 2014 16:56:35 +0000
treeherdermozilla-central@6ca3405c22e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1087120
milestone36.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 1087120 - Fix intermittent browser_ContentSearch.js failure by increasing timeout for remote search suggestions. r=MattN
browser/modules/test/browser_ContentSearch.js
--- a/browser/modules/test/browser_ContentSearch.js
+++ b/browser/modules/test/browser_ContentSearch.js
@@ -1,16 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const TEST_MSG = "ContentSearchTest";
 const CONTENT_SEARCH_MSG = "ContentSearch";
 const TEST_CONTENT_SCRIPT_BASENAME = "contentSearch.js";
 
+// This timeout is absurdly high to avoid random failures like bug 1087120.
+// That bug was reported when the timeout was 5 seconds, so let's try 10.
+const SUGGESTIONS_TIMEOUT = 10000;
+
 var gMsgMan;
 
 add_task(function* GetState() {
   yield addTab();
   gMsgMan.sendAsyncMessage(TEST_MSG, {
     type: "GetState",
   });
   let msg = yield waitForTestMsg("State");
@@ -196,17 +200,17 @@ add_task(function* GetSuggestions_AddFor
 
   // Send GetSuggestions using the test engine.  Its suggestions should appear
   // in the remote suggestions in the Suggestions response below.
   gMsgMan.sendAsyncMessage(TEST_MSG, {
     type: "GetSuggestions",
     data: {
       engineName: engine.name,
       searchString: searchStr,
-      remoteTimeout: 5000,
+      remoteTimeout: SUGGESTIONS_TIMEOUT,
     },
   });
 
   // Check the Suggestions response.
   let msg = yield waitForTestMsg("Suggestions");
   checkMsg(msg, {
     type: "Suggestions",
     data: {
@@ -232,17 +236,17 @@ add_task(function* GetSuggestions_AddFor
   yield deferred.promise;
 
   // Send GetSuggestions again.
   gMsgMan.sendAsyncMessage(TEST_MSG, {
     type: "GetSuggestions",
     data: {
       engineName: engine.name,
       searchString: searchStr,
-      remoteTimeout: 5000,
+      remoteTimeout: SUGGESTIONS_TIMEOUT,
     },
   });
 
   // The formHistory suggestions in the Suggestions response should be empty.
   msg = yield waitForTestMsg("Suggestions");
   checkMsg(msg, {
     type: "Suggestions",
     data: {