No bug - Adjust mozscreenshots timeouts to deal with winxp bustage. r=bustage
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Mon, 30 May 2016 13:14:22 -0700
changeset 340530 6bbf9b8467b1ed1a6b8b64a8f5ae0da3db3df239
parent 340529 5c8f09493cadc33fc6aa05f52cabbabb15b9593a
child 340531 5e6a99ab5e9a9ff893f7e12e19639847cae068f0
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
milestone49.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
No bug - Adjust mozscreenshots timeouts to deal with winxp bustage. r=bustage MozReview-Commit-ID: ELWk8BX7zLO
browser/tools/mozscreenshots/head.js
browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js
--- a/browser/tools/mozscreenshots/head.js
+++ b/browser/tools/mozscreenshots/head.js
@@ -7,17 +7,17 @@
 const {AddonWatcher} = Cu.import("resource://gre/modules/AddonWatcher.jsm", {});
 const chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
 const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
 const EXTENSION_DIR = "chrome://mochitests/content/extensions/mozscreenshots/browser/";
 
 let TestRunner;
 
 function* setup() {
-  requestLongerTimeout(20);
+  requestLongerTimeout(10);
 
   info("installing extension temporarily");
   let chromeURL = Services.io.newURI(EXTENSION_DIR, null, null);
   let dir = chromeRegistry.convertChromeURL(chromeURL).QueryInterface(Ci.nsIFileURL).file;
   yield AddonManager.installTemporaryAddon(dir);
 
   info("Checking for mozscreenshots extension");
   return new Promise((resolve) => {
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["TestRunner"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
+const APPLY_CONFIG_TIMEOUT_MS = 60 * 1000;
 const HOME_PAGE = "chrome://mozscreenshots/content/lib/mozscreenshots.html";
 
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/Timer.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
@@ -151,21 +152,24 @@ this.TestRunner = {
 
   _performCombo: function*(combo) {
     let paddedComboIndex = padLeft(this.currentComboIndex + 1, String(this.combos.length).length);
     log.info("Combination " + paddedComboIndex + "/" + this.combos.length + ": " +
              this._comboName(combo).substring(1));
 
     function changeConfig(config) {
       log.debug("calling " + config.name);
-      let promise = Promise.resolve(config.applyConfig());
+      let applyPromise = Promise.resolve(config.applyConfig());
+      let timeoutPromise = new Promise((resolve, reject) => {
+        setTimeout(reject, APPLY_CONFIG_TIMEOUT_MS, "Timed out");
+      });
       log.debug("called " + config.name);
       // Add a default timeout of 500ms to avoid conflicts when configurations
       // try to apply at the same time. e.g WindowSize and TabsInTitlebar
-      return promise.then(() => {
+      return Promise.race([applyPromise, timeoutPromise]).then(() => {
         return new Promise((resolve) => {
           setTimeout(resolve, 500);
         });
       });
     }
 
     try {
       // First go through and actually apply all of the configs
--- a/browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js
+++ b/browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js
@@ -3,12 +3,14 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 add_task(function* capture() {
   if (!shouldCapture()) {
     return;
   }
+
+  requestLongerTimeout(20);
+
   let sets = ["TabsInTitlebar", "Tabs", "WindowSize", "Toolbars", "LightweightThemes"];
-
   yield TestRunner.start(sets, "primaryUI");
 });