Bug 866293 - Increase test timeout threshold to avoid intermittent test failures. r=Yoric
authorYura Zenevich <yura.zenevich@gmail.com>
Tue, 30 Apr 2013 10:26:46 -0400
changeset 130340 d2348909462c06471e2f5f69bfac6bbcc5782c26
parent 130339 598cfd4cb5ebfd40e1e6d833c236dae2e292a825
child 130341 2d3b020b23cd9e370f37201a45452a3458a9287e
push id27314
push userryanvm@gmail.com
push dateTue, 30 Apr 2013 14:26:51 +0000
treeherdermozilla-inbound@d2348909462c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs866293
milestone23.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 866293 - Increase test timeout threshold to avoid intermittent test failures. r=Yoric
toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
--- a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
+++ b/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
@@ -835,16 +835,19 @@ let test_system_shutdown = maketest("sys
         let cleanUp = function cleanUp() {
           Services.console.unregisterListener(listener);
           OS.Shared.DEBUG = originalDebug;
           OS.Shared.TEST = false;
           test.info("Unregistered listener for resource " + resource);
         };
         waitObservation.promise.then(cleanUp, cleanUp);
 
+        // Measure how long it takes to receive a log message.
+        let logStart;
+
         let listener = {
           observe: function (aMessage) {
             test.info("Waiting for a console message mentioning resource " + resource);
             // Ignore unexpected messages.
             if (!(aMessage instanceof Components.interfaces.nsIConsoleMessage)) {
               test.info("Not a console message");
               return;
             }
@@ -856,64 +859,67 @@ let test_system_shutdown = maketest("sys
               "detected.") >= 0, "Noticing file descriptors leaks, as expected.");
             let found = aMessage.message.indexOf(resource) >= 0;
             if (found) {
               if (++logCounter > 2) {
                 test.fail("test.osfile.web-workers-shutdown observer should only " +
                   "be activated 2 times.");
               }
               test.ok(true, "Leaked resource is correctly listed in the log.");
+              test.info(
+                "It took " + (Date.now() - logStart) + "MS to receive a log message.");
               setTimeout(function() { waitObservation.resolve(); });
             } else {
               test.info("This log didn't list the expected resource: " + resource + "\ngot " + aMessage.message);
             }
           }
         };
         Services.console.registerListener(listener);
+        logStart = Date.now();
         f();
         // If listener does not resolve webObservation in timely manner (100MS),
         // reject it.
         setTimeout(function() {
           test.info("waitObservation timeout exceeded.");
           waitObservation.reject();
-        }, 100);
+        }, 500);
         yield waitObservation.promise;
       });
     }
 
     // Enable test shutdown observer.
     Services.prefs.setBoolPref("toolkit.osfile.test.shutdown.observer", true);
 
     let currentDir = yield OS.File.getCurrentDirectory();
     test.info("Testing for leaks of directory iterator " + currentDir);
     let iterator = new OS.File.DirectoryIterator(currentDir);
     try {
       yield inDebugTest(currentDir, function() {
         Services.obs.notifyObservers(null, "test.osfile.web-workers-shutdown",
           null);
       });
-      test.ok(true, "Log messages observervation promise resolved as expected.");
+      test.ok(true, "Log messages observation promise resolved as expected.");
     } catch (ex) {
-      test.fail("Log messages observervation promise was rejected.");
+      test.fail("Log messages observation promise was rejected.");
     }
     yield iterator.close();
 
     let testFileDescriptorsLeaks = function testFileDescriptorsLeaks(shouldResolve) {
       return Task.spawn(function task() {
         let openedFile = yield OS.File.open(EXISTING_FILE);
         try {
           yield inDebugTest(EXISTING_FILE, function() {
             Services.obs.notifyObservers(null, "test.osfile.web-workers-shutdown",
               null);
           });
           test.ok(shouldResolve,
-            "Log message observervation promise resolved as expected.");
+            "Log message observation promise resolved as expected.");
         } catch (ex) {
           test.ok(!shouldResolve,
-            "Log message observervation promise was rejected as expected.");
+            "Log message observation promise was rejected as expected.");
         }
         yield openedFile.close();
       });
     };
 
     test.info("Testing for leaks of file " + EXISTING_FILE);
     yield testFileDescriptorsLeaks(true);