Closed Bug 1149363 Opened 10 years ago Closed 10 years ago

For xpcshell tests instead of throwing fail the test so it is easily understood what is going on

Categories

(Toolkit :: Application Update, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: robert.strong.bugs, Assigned: robert.strong.bugs)

References

Details

Attachments

(1 file, 1 obsolete file)

It would be better to fail the test instead of calling do_throw to differentiate what is failing per bug 1148775.
Attached patch patch rev1 (obsolete) — Splinter Review
I will change the rest of the do_check_* calls to Assert.* calls in bug 1149276. They provide much better info in the logs so there is less ambiguity when determining failures on treeherder.
Assignee: nobody → robert.strong.bugs
Status: NEW → ASSIGNED
Attachment #8585890 - Flags: review?(spohl.mozilla.bugs)
Comment on attachment 8585890 [details] [diff] [review] patch rev1 B2G seems to run into failures. Clearing r? request for now.
Attachment #8585890 - Flags: review?(spohl.mozilla.bugs)
Comment on attachment 8585890 [details] [diff] [review] patch rev1 Fairly certain this try run with just this patch will be fine
Attachment #8585890 - Flags: review?(spohl.mozilla.bugs)
Try is looking good
Try passed 100%
Comment on attachment 8585890 [details] [diff] [review] patch rev1 Review of attachment 8585890 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! r+ with questions answered/comments addressed. ::: toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js @@ +1595,4 @@ > if (IS_AUTHENTICODE_CHECK_ENABLED && isBinarySigned(updaterBinPath)) { > + logTestInfo("the " + updaterBinPath + " file is signed but the test " + > + "registry key does not exist - failing the test since this " + > + "is likely a build system without the test registry key"); Does the logTestInfo here add much value (because it's printed in a location that's more accessible maybe)? If not, could we remove the |&& isBinarySigned(updaterBinPath)| from the if condition and instead just do the |isBinarySigned(updaterBinPath)| check as part of the |Assert.ok|? @@ +1628,5 @@ > > if (IS_AUTHENTICODE_CHECK_ENABLED && !isBinarySigned(updaterBinPath)) { > logTestInfo("test registry key exists but this test can only run on " + > "builds with signed binaries when " + > "DISABLE_UPDATER_AUTHENTICODE_CHECK is not defined"); same question here as above @@ +1960,2 @@ > if (aFailTest) { > + Assert.ok(false, "maintenance service should stop! Process " + Assert.ok(!aFailTest, ... @@ +3474,5 @@ > if (gProcess.isRunning) { > logTestInfo("attempt to kill process"); > gProcess.kill(); > } > + do_throw("Launch application timer expired!"); |Assert.ok(false, "Launch application timer shouldn't expire")| ?
Attachment #8585890 - Flags: review?(spohl.mozilla.bugs) → review+
(In reply to Stephen Pohl [:spohl] from comment #8) > Comment on attachment 8585890 [details] [diff] [review] > patch rev1 > > Review of attachment 8585890 [details] [diff] [review]: > ----------------------------------------------------------------- > > Looks good! r+ with questions answered/comments addressed. > > ::: toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js > @@ +1595,4 @@ > > if (IS_AUTHENTICODE_CHECK_ENABLED && isBinarySigned(updaterBinPath)) { > > + logTestInfo("the " + updaterBinPath + " file is signed but the test " + > > + "registry key does not exist - failing the test since this " + > > + "is likely a build system without the test registry key"); > > Does the logTestInfo here add much value (because it's printed in a location > that's more accessible maybe)? If not, could we remove the |&& > isBinarySigned(updaterBinPath)| from the if condition and instead just do > the |isBinarySigned(updaterBinPath)| check as part of the |Assert.ok|? Likely not and changed. > @@ +1628,5 @@ > > > > if (IS_AUTHENTICODE_CHECK_ENABLED && !isBinarySigned(updaterBinPath)) { > > logTestInfo("test registry key exists but this test can only run on " + > > "builds with signed binaries when " + > > "DISABLE_UPDATER_AUTHENTICODE_CHECK is not defined"); > > same question here as above ditto > @@ +1960,2 @@ > > if (aFailTest) { > > + Assert.ok(false, "maintenance service should stop! Process " + > > Assert.ok(!aFailTest, ... Since this ends up in the log I'd prefer only doing this when it has failed since the logs are confusing enough. > @@ +3474,5 @@ > > if (gProcess.isRunning) { > > logTestInfo("attempt to kill process"); > > gProcess.kill(); > > } > > + do_throw("Launch application timer expired!"); > > |Assert.ok(false, "Launch application timer shouldn't expire")| ? changed
Attachment #8585890 - Attachment is obsolete: true
Attachment #8587173 - Flags: review+
Flags: in-testsuite+
Target Milestone: --- → mozilla40
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: