Closed Bug 654162 Opened 14 years ago Closed 14 years ago

TEST FAILED: test-main.testMain (exception)

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ashah, Assigned: myk)

References

Details

(Whiteboard: [cherry-pick-1.0b5])

Attachments

(1 file)

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)
Blocks: addonsdk10b5
No longer blocks: addonsdk10b5
OS: Mac OS X → All
Hardware: x86 → All
Blocks: addonsdk10b5
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?
Assignee: nobody → myk
Status: NEW → ASSIGNED
Attachment #529586 - Flags: review?(warner-bugzilla)
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.
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 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+
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.

Attachment

General

Created:
Updated:
Size: