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 267570 46bb079343276f8d42fdbf630ff9c7cc90b89a4d
parent 267569 d68fc8a46c1ace425fb537560fc9d1290d10d8b0
child 267571 b671922dedffc270b951ce665d9d82750201acf3
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [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");