TEST FAILED: test-main.testMain (exception)

RESOLVED FIXED

Status

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: ashah, Assigned: myk)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
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

7 years ago
Blocks: 653186
(Reporter)

Comment 1

7 years ago
Logs: http://pastebin.mozilla.org/1217283
No longer blocks: 653186
OS: Mac OS X → All
Hardware: x86 → All
(Reporter)

Updated

7 years ago
Blocks: 653186
(Assignee)

Comment 2

7 years ago
Created attachment 529586 [details] [diff] [review]
patch v1: "fixes" problem

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+
(Assignee)

Comment 6

7 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
Last Resolved: 7 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.