Closed Bug 1090784 Opened 7 years ago Closed 7 years ago

Calendar xpcshell tests fail with ReferenceError: _passedChecks is not defined at .../calendar/test/unit/head_consts.js:217

Categories

(Calendar :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ssitter, Assigned: ssitter)

References

Details

(Keywords: intermittent-failure, regression)

Attachments

(1 file)

https://tbpl.mozilla.org/php/getParsedLog.php?id=51287303&tree=Thunderbird-Trunk

> TEST-UNEXPECTED-FAIL | /builds/slave/test/build/tests/xpcshell/tests/calendar/test/unit/test_alarm.js | xpcshell return code: 0
> ReferenceError: _passedChecks is not defined at /builds/slave/test/build/tests/xpcshell/tests/calendar/test/unit/head_consts.js:217

When comparing <http://mxr.mozilla.org/comm-central/search?string=_passedChecks> with <http://mxr.mozilla.org/comm-aurora/search?string=_passedChecks> it is visible that _passedChecks was previously defined in mozilla/testing/xpcshell/head.js but is no longer there.
This is eventually a regression of bug 1033126, which removed _passedChecks from mozilla/testing/xpcshell/head.js
Blocks: 1033126
I am guessing the following diff fixes this issue, but I can't confirm it because now I can't run any xpcshell tests in calendar on my local machine.


diff --git a/calendar/test/unit/head_consts.js b/calendar/test/unit/head_consts.js
--- a/calendar/test/unit/head_consts.js
+++ b/calendar/test/unit/head_consts.js
@@ -209,19 +209,19 @@ function do_check_throws(func, result, s
 {
   if (!stack)
     stack = Components.stack.caller;

   try {
     func();
   } catch (exc) {
     if (exc.result == result || exc == result) {
-      ++_passedChecks;
-      dump("TEST-PASS | " + stack.filename + " | [" + stack.name + " : " +
-           stack.lineNumber + "] " + exc.result + " == " + result + "\n");
+      let msg = stack.filename + " | [" + stack.name + " : " +
+           stack.lineNumber + "] " + exc.result + " == " + result + "\n";
+      do_report_result(true, msg, stack);
       return;
     }
     do_throw("expected result " + result + ", caught " + (exc.result || exc), stack);
   }

   if (result) {
     do_throw("expected result " + result + ", none thrown", stack);
   }
Based on the log file and the cc mxr search Stefan referenced, I assume, there's also a fix required for the two occurrences of _passedChecks in the gloda test code. This may fix the timeouts visible in the log. I haven't seen a separate bug for this, so it probably makes sense to include it here?
I think bug 1091077 will cover the _passedChecks in the gloda.
Keywords: regression
Assignee: nobody → ssitter
Status: NEW → ASSIGNED
Attachment #8514585 - Flags: review?(philipp)
Comment on attachment 8514585 [details] [diff] [review]
regression fix for xpcshell tests

Review of attachment 8514585 [details] [diff] [review]:
-----------------------------------------------------------------

Isn't there an official do_throw helper by now? Anyway r=me since this fixes it.
Attachment #8514585 - Flags: review?(philipp) → review+
Maybe you meant Assert.jsm (Bug 1022342)?

Pushed to https://hg.mozilla.org/comm-central/rev/5df0a26967c8
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.8
You need to log in before you can comment on or make changes to this bug.