Closed
Bug 654162
Opened 14 years ago
Closed 14 years ago
TEST FAILED: test-main.testMain (exception)
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ashah, Assigned: myk)
References
Details
(Whiteboard: [cherry-pick-1.0b5])
Attachments
(1 file)
573 bytes,
patch
|
warner
:
review+
|
Details | Diff | Splinter Review |
SDK - 1.0b5RC1
Firefox - FFx4.0.1
Platform - Mac OS x 10.6
While running integration tests on the above mentioned platform, there was one
failure.
The detailed failure is as follows:
error: TEST FAILED: test-main.testMain (exception)
error: An exception occurred.
Traceback (most recent call last):
File "resource://anonid0-reddit-panel-reddit-panel-tests/test-main.js", line 12, in
m.main({ staticArgs: {quitWhenDone: true} }, callbacks);
TypeError: m.main is not a function
The logs for this testrun are here - http://pastebin.mozilla.org/1217283
(FYI - the command running from inside the integration script is cfx testall -a firefox)
Assignee | ||
Updated•14 years ago
|
Blocks: addonsdk10b5
Reporter | ||
Comment 1•14 years ago
|
||
Reporter | ||
Updated•14 years ago
|
Blocks: addonsdk10b5
Assignee | ||
Comment 2•14 years ago
|
||
This "fixes" the problem, although it still isn't clear why it started happening (loader changes?), and it feels weird to add this code to the main module just to make one of its tests pass.
Brian: what do you think?
Comment 3•14 years ago
|
||
Looks ok to me, but I share your concern: how could it possibly have been working before? Unless.. it's conceivable that previously the require("main") was importing an entirely unrelated module (not reddit-panel/lib/main.js), which *did* have a main() export. And if the linker is now getting the right module, which doesn't have main(), now it's failing. Seems unlikely, but possible.
Ohhh.. as the bug 654095 comment points out, module search in the new linker is hitting packages in a random order (according to how python's dictionaries iterate over their keys). Previously the JS code at runtime was looking through packages in an order that depended upon the way they declared their mututal dependencies. So I wouldn't assume that seeing the failure go away means the problem is fixed: it might change when the dict's iteration order changes. This needs a better fix. I'll think more in 654095.
Comment 4•14 years ago
|
||
There's a main.js in packages/development-mode, with a main() function, which writes "Starting." to the console and then contacts a localhost HTTP server for instructions. Do we have a log from a previously-passing run of this test? Did it emit "Starting." to the console? That would be good evidence that we were previously invoking the wrong main(), and the new linker changes it somehow.
Comment 5•14 years ago
|
||
Comment on attachment 529586 [details] [diff] [review]
patch v1: "fixes" problem
Ah, nothing quite so complicated. https://github.com/mozilla/addon-sdk/commit/fa651783509bcd11127369b2a8c828b58c057018#diff-3 (landed 29-Apr) accidentally removed exports.main from the annotator example. The test fails with that change. (the buildbot should have told us about this failure right away)
So this patch is the correct fix. r+!
Attachment #529586 -
Flags: review?(warner-bugzilla) → review+
Assignee | ||
Comment 6•14 years ago
|
||
Committed:
https://github.com/mozilla/addon-sdk/commit/8e1b9e9b3b0486387b315788d64b604f162816e9
Cherry-picked to 1.0b5 branch:
https://github.com/mozilla/addon-sdk/commit/eba2a27d8a75082035f1e59d2944d363a65b8f93
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [cherry-pick-1.0b5]
You need to log in
before you can comment on or make changes to this bug.
Description
•