Bug 465490 - Intermittent time out after test_0051_general.js: test_0110_general.js hangs randomly.

This commit is contained in:
Robert Strong 2009-04-13 20:19:03 -07:00
parent b758ddf2ee
commit 96c7170d8d
4 changed files with 26 additions and 32 deletions

View File

@ -1,6 +0,0 @@
<?xml version="1.0"?>
<updates>
<update type="major" version="4.0" extensionVersion="4.0" buildID="20080811053724" licenseURL="http://dummylicense" detailsURL="http://dummydetails/">
<patch type="complete" URL="http://localhost:4444/data/aus-0110_general-1.mar" hashFunction="SHA1" hashValue="246522844a98564e831d89b8c9243efca90f687e" size="1444"/>
</update>
</updates>

View File

@ -1,6 +0,0 @@
<?xml version="1.0"?>
<updates>
<update type="major" version="4.0" extensionVersion="4.0" buildID="20080811053724" licenseURL="http://dummylicense" detailsURL="http://dummydetails/">
<patch type="partial" URL="http://localhost:4444/data/aus-0110_general-2.mar" hashFunction="SHA1" hashValue="62eeb2a3b4d0c46589400dd8e6806f707da05c3e" size="1255"/>
</update>
</updates>

View File

@ -82,14 +82,18 @@ function run_test() {
// Use a directory outside of dist/bin to lessen the garbage in dist/bin
var updatesSubDir = do_get_cwd();
updatesSubDir.append("app_dir");
updatesSubDir.append("updates");
updatesSubDir.append("0");
updatesSubDir.append("0110_complete_mar");
dump("Testing: cleanup of the updates directory used to test\n");
if (updatesSubDir.exists())
updatesSubDir.remove(true);
do_check_false(updatesSubDir.exists());
try {
// Mac OS X intermittently fails when removing the dir where the updater
// binary was launched.
if (updatesSubDir.exists())
updatesSubDir.remove(true);
}
catch (e) {
dump("Unable to remove directory\npath: " + updatesSubDir.path +
"\nException: " + e + "\n");
}
var mar = do_get_file("data/aus-0110_general-1.mar");
mar.copyTo(updatesSubDir, "update.mar");
@ -109,6 +113,8 @@ function run_test() {
do_check_eq(getFileBytes(srcImage), getFileBytes(refImage));
try {
// Mac OS X intermittently fails when removing the dir where the updater
// binary was launched.
if (updatesSubDir.exists())
updatesSubDir.remove(true);
}
@ -116,9 +122,6 @@ function run_test() {
dump("Unable to remove directory\npath: " + updatesSubDir.path +
"\nException: " + e + "\n");
}
dump("Testing: successful removal of the updates subdirectory where the " +
"updater binary was launched\n");
do_check_false(updatesSubDir.exists());
}
// Launches the updater binary to apply a mar file

View File

@ -89,14 +89,18 @@ function run_test() {
// Use a directory outside of dist/bin to lessen the garbage in dist/bin
var updatesSubDir = do_get_cwd();
updatesSubDir.append("app_dir");
updatesSubDir.append("updates");
updatesSubDir.append("0");
updatesSubDir.append("0111_partial_mar");
dump("Testing: cleanup of the updates directory used to test\n");
if (updatesSubDir.exists())
updatesSubDir.remove(true);
do_check_false(updatesSubDir.exists());
try {
// Mac OS X intermittently fails when removing the dir where the updater
// binary was launched.
if (updatesSubDir.exists())
updatesSubDir.remove(true);
}
catch (e) {
dump("Unable to remove directory\npath: " + updatesSubDir.path +
"\nException: " + e + "\n");
}
var mar = do_get_file("data/aus-0110_general-2.mar");
mar.copyTo(updatesSubDir, "update.mar");
@ -118,6 +122,8 @@ function run_test() {
do_check_eq(getFileBytes(srcImage), getFileBytes(refImage));
try {
// Mac OS X intermittently fails when removing the dir where the updater
// binary was launched.
if (updatesSubDir.exists())
updatesSubDir.remove(true);
}
@ -125,9 +131,6 @@ function run_test() {
dump("Unable to remove directory\npath: " + updatesSubDir.path +
"\nException: " + e + "\n");
}
dump("Testing: successful removal of the updates subdirectory where the " +
"updater binary was launched\n");
do_check_false(updatesSubDir.exists());
}
// Launches the updater binary to apply a mar file