Closed Bug 701193 Opened 8 years ago Closed 8 years ago

xpcshell-tests for add-on manager broken when update channel is set to aurora/beta/release

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla11
Tracking Status
firefox10 --- fixed

People

(Reporter: standard8, Assigned: darktrojan)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Following on from the fixes in bug 700988, xpcshell tests are still broken when the update channel is set to one of aurora, beta, or release. This means our aurora nightly tests fail.

Typical example:

TEST-UNEXPECTED-FAIL | /buildbot/comm-aurora-linux-opt-unittest-xpcshell/build/xpcshell/tests/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js | test failed (with xpcshell return code: 3), see following log:
>>>>>>>
uncaught exception: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXPCComponents_Utils.import]"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: /buildbot/comm-aurora-linux-opt-unittest-xpcshell/build/xpcshell/tests/toolkit/mozapps/extensions/test/xpcshell/head_addons.js :: <TOP_LEVEL> :: line 15"  data: no]
<<<<<<<

I've tracked this down to this line of code:

const PREF_CHECK_COMPATIBILITY = PREF_CHECK_COMPATIBILITY_BASE + "." +
                                 Services.appinfo.version.replace(BRANCH_REGEXP, "$1");

Although bug 700988 has defined BRANCH_REGEXP, the issue now is Services.appinfo.version. If I replace that with a standard variable, the tests pass.

Now I get confused, head_addons.js clearly defines nsIXULAppInfo, but that doesn't seem to be getting picked up here, maybe it is too early in xpcshell's load process?

I'm not going to be able to work on this now, so if others can pick it up that'd be useful.
The module is being imported at the top level, before createAppInfo() is called in the test, and the Services.appinfo.version reference is a global in the module, so it's run at import time. You could probably solve the issue by computing PREF_CHECK_COMPATIBILITY lazily...
Attached patch fixSplinter Review
I'll push this to try with the Makefile rigged to cause the bug.
Attachment #573342 - Flags: review?(dtownsend)
Looks like this is working fine on try, if you ignore the random oranges and the timebomb. I also filed bug 701298 which would cause orange in the same circumstances.
https://tbpl.mozilla.org/?tree=Try&rev=adab1f1bb32c
Attachment #573342 - Flags: review?(dtownsend) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/141b495ea4f5
Assignee: nobody → geoff
Status: NEW → ASSIGNED
Flags: in-testsuite-
Flags: in-litmus-
Target Milestone: --- → mozilla11
Comment on attachment 573342 [details] [diff] [review]
fix

This needs to land on aurora so it can actually pass its tests.
Attachment #573342 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/141b495ea4f5
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Comment on attachment 573342 [details] [diff] [review]
fix

[Triage Comment]
Fixes orange, approving for aurora.
Attachment #573342 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Marking qa- as there is nothing QA needs to verify here. Please set to qa+ if this is not the case.
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.