Bug 615467 - intermittent failure in toolkit\mozapps\update\test\unit\test_0170_fileLocked_xp_win_complete.js | test failed (with xpcshell return code: 0), see following log: succeeded == failed. r=dtownsend, a=test fix
authorRobert Strong <robert.bugzilla@gmail.com>
Thu, 02 Dec 2010 19:57:20 -0800
changeset 58533 065c920fb3723dc8ec32c2b1bc544d8b7e5be81e
parent 58532 da02b204f064819a9b6ec223c13570f269355a24
child 58534 a4813c8be814ca7dd0faaedb9dc6d30791f34de8
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersdtownsend, test
bugs615467
milestone2.0b8pre
Bug 615467 - intermittent failure in toolkit\mozapps\update\test\unit\test_0170_fileLocked_xp_win_complete.js | test failed (with xpcshell return code: 0), see following log: succeeded == failed. r=dtownsend, a=test fix
toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js
--- a/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
+++ b/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
@@ -4,16 +4,18 @@
 
 /* Application in use complete MAR file patch apply success test */
 
 const TEST_ID = "0160";
 // All we care about is that the last modified time has changed so that Mac OS
 // X Launch Services invalidates its cache so the test allows up to one minute
 // difference in the last modified time.
 const MAX_TIME_DIFFERENCE = 60000;
+// Time to wait for the test helper process to start before continuing the test
+const TEST_HELPER_TIMEOUT = 1000;
 
 // The files are in the same order as they are applied from the mar
 const TEST_FILES = [
 {
   fileName         : "1_1_image1.png",
   destinationDir   : TEST_ID + APPLY_TO_DIR_SUFFIX + "/mar_test/1/1_1/",
   originalContents : null,
   compareContents  : null,
@@ -81,17 +83,17 @@ function run_test() {
   let args = ["-s", "20"];
   gCallbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                         createInstance(AUS_Ci.nsIProcess);
   gCallbackAppProcess.init(callbackApp);
   gCallbackAppProcess.run(false, args, args.length);
 
   // Give the lock file process time to lock the file before updating otherwise
   // this test can fail intermittently on Windows debug builds.
-  do_timeout(100, testUpdate);
+  do_timeout(TEST_HELPER_TIMEOUT, testUpdate);
 }
 
 function end_test() {
   cleanupUpdaterTest(TEST_ID);
 }
 
 function testUpdate() {
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
--- a/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete.js
+++ b/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete.js
@@ -1,15 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* Application in use complete MAR file patch apply failure test */
 
 const TEST_ID = "0160";
+// Time to wait for the test helper process to start before continuing the test
+const TEST_HELPER_TIMEOUT = 1000;
 
 // The files are in the same order as they are applied from the mar
 const TEST_FILES = [
 {
   fileName         : "1_1_image1.png",
   destinationDir   : TEST_ID + APPLY_TO_DIR_SUFFIX + "/mar_test/1/1_1/",
   originalContents : null,
   compareContents  : null,
@@ -65,17 +67,17 @@ function run_test() {
   let args = ["-s", "20"];
   gCallbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                         createInstance(AUS_Ci.nsIProcess);
   gCallbackAppProcess.init(callbackApp);
   gCallbackAppProcess.run(false, args, args.length);
 
   // Give the lock file process time to lock the file before updating otherwise
   // this test can fail intermittently on Windows debug builds.
-  do_timeout(100, testUpdate);
+  do_timeout(TEST_HELPER_TIMEOUT, testUpdate);
 }
 
 function end_test() {
   cleanupUpdaterTest(TEST_ID);
 }
 
 function testUpdate() {
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
--- a/toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js
+++ b/toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js
@@ -1,15 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File locked complete MAR file patch apply failure test */
 
 const TEST_ID = "0170";
+// Time to wait for the test helper process to start before continuing the test
+const TEST_HELPER_TIMEOUT = 1000;
 
 // The files are in the same order as they are applied from the mar
 const TEST_FILES = [
 {
   fileName         : "1_1_image1.png",
   destinationDir   : TEST_ID + APPLY_TO_DIR_SUFFIX + "/mar_test/1/1_1/",
   originalContents : null,
   compareContents  : null,
@@ -64,17 +66,17 @@ function run_test() {
   let args = ["-s", "20", lockFileRelPath];
   gLockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   gLockFileProcess.init(helperBin);
   gLockFileProcess.run(false, args, args.length);
 
   // Give the lock file process time to lock the file before updating otherwise
   // this test can fail intermittently on Windows debug builds.
-  do_timeout(100, testUpdate);
+  do_timeout(TEST_HELPER_TIMEOUT, testUpdate);
 }
 
 function end_test() {
   cleanupUpdaterTest(TEST_ID);
 }
 
 function testUpdate() {
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
--- a/toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js
+++ b/toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js
@@ -1,15 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File locked partial MAR file patch apply failure test */
 
 const TEST_ID = "0171";
+// Time to wait for the test helper process to start before continuing the test
+const TEST_HELPER_TIMEOUT = 1000;
 
 // The files are in the same order as they are applied from the mar
 const TEST_FILES = [
 {
   fileName         : "1_1_image1.png",
   destinationDir   : TEST_ID + APPLY_TO_DIR_SUFFIX + "/mar_test/1/1_1/",
   originalContents : null,
   compareContents  : null,
@@ -64,17 +66,17 @@ function run_test() {
   let args = ["-s", "20", lockFileRelPath];
   gLockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   gLockFileProcess.init(helperBin);
   gLockFileProcess.run(false, args, args.length);
 
   // Give the lock file process time to lock the file before updating otherwise
   // this test can fail intermittently on Windows debug builds.
-  do_timeout(100, testUpdate);
+  do_timeout(TEST_HELPER_TIMEOUT, testUpdate);
 }
 
 function end_test() {
   cleanupUpdaterTest(TEST_ID);
 }
 
 function testUpdate() {
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
--- a/toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js
+++ b/toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js
@@ -1,15 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File in use complete MAR file patch apply success test */
 
 const TEST_ID = "0180";
+// Time to wait for the test helper process to start before continuing the test
+const TEST_HELPER_TIMEOUT = 1000;
 
 // The files are in the same order as they are applied from the mar
 const TEST_FILES = [
 {
   fileName         : "1_1_image1.png",
   destinationDir   : TEST_ID + APPLY_TO_DIR_SUFFIX + "/mar_test/1/1_1/",
   originalContents : null,
   compareContents  : null,
@@ -64,17 +66,17 @@ function run_test() {
   let args = ["-s", "20"];
   gFileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                       createInstance(AUS_Ci.nsIProcess);
   gFileInUseProcess.init(fileInUseBin);
   gFileInUseProcess.run(false, args, args.length);
 
   // Give the file in use process time to launch before updating otherwise this
   // test can fail intermittently on Windows debug builds.
-  do_timeout(100, testUpdate);
+  do_timeout(TEST_HELPER_TIMEOUT, testUpdate);
 }
 
 function end_test() {
   cleanupUpdaterTest(TEST_ID);
 }
 
 function testUpdate() {
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
--- a/toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js
+++ b/toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js
@@ -1,16 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File in use partial MAR file patch apply success test */
 
 const TEST_ID = "0181";
 const MAR_IN_USE_WIN_FILE = "data/partial_in_use_win.mar";
+// Time to wait for the test helper process to start before continuing the test
+const TEST_HELPER_TIMEOUT = 1000;
 
 // The files are in the same order as they are applied from the mar
 var TEST_FILES = [
 {
   fileName         : "1_1_image1.png",
   destinationDir   : TEST_ID + APPLY_TO_DIR_SUFFIX + "/mar_test/1/1_1/",
   originalContents : null,
   compareContents  : null,
@@ -79,17 +81,17 @@ function run_test() {
   let args = ["-s", "20"];
   gFileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                       createInstance(AUS_Ci.nsIProcess);
   gFileInUseProcess.init(fileInUseBin);
   gFileInUseProcess.run(false, args, args.length);
 
   // Give the file in use process time to launch before updating otherwise this
   // test can fail intermittently on Windows debug builds.
-  do_timeout(100, testUpdate);
+  do_timeout(TEST_HELPER_TIMEOUT, testUpdate);
 }
 
 function end_test() {
   cleanupUpdaterTest(TEST_ID);
 }
 
 function testUpdate() {
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);