Bug 982201 - Don't give up so easily when constructing netmonitor statistics view during tests. r=past, a=test-only
authorSami Jaktholm <sjakthol@outlook.com>
Sat, 23 May 2015 07:16:22 +0300
changeset 266108 46bb07934327
parent 266107 d68fc8a46c1a
child 266109 b671922dedff
push id4755
push userryanvm@gmail.com
push date2015-05-25 19:46 +0000
treeherdermozilla-beta@46bb07934327 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast, test-only
bugs982201
milestone39.0
Bug 982201 - Don't give up so easily when constructing netmonitor statistics view during tests. r=past, a=test-only In tests it doesn't make sense to give up after two seconds as we want to test the actual feature - not that it can do everything in under two seconds which is quite a long shot on debug builds. The new 45 second timeout during tests matches the 45 second timeout of mochitests which essentially makes it impossible for whenDataAvailable to timeout during tests causing these false positives.
browser/devtools/netmonitor/netmonitor-controller.js
--- a/browser/devtools/netmonitor/netmonitor-controller.js
+++ b/browser/devtools/netmonitor/netmonitor-controller.js
@@ -850,17 +850,22 @@ function whenDataAvailable(aDataStore, a
     clearInterval(interval);
     deferred.reject(new Error("Timed out while waiting for data"));
   }, WDA_DEFAULT_GIVE_UP_TIMEOUT);
 
   return deferred.promise;
 };
 
 const WDA_DEFAULT_VERIFY_INTERVAL = 50; // ms
-const WDA_DEFAULT_GIVE_UP_TIMEOUT = 2000; // ms
+
+// Use longer timeout during testing as the tests need this process to succeed
+// and two seconds is quite short on slow debug builds. The timeout here should
+// be at least equal to the general mochitest timeout of 45 seconds so that this
+// never gets hit during testing.
+const WDA_DEFAULT_GIVE_UP_TIMEOUT = gDevTools.testing ? 45000 : 2000; // ms
 
 /**
  * Helper method for debugging.
  * @param string
  */
 function dumpn(str) {
   if (wantLogging) {
     dump("NET-FRONTEND: " + str + "\n");