Closed Bug 1237641 Opened 7 years ago Closed 7 years ago

devtools/client/inspector/test/browser_inspector_initialization.js fails when run in isolation

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox46 fixed)

RESOLVED FIXED
Firefox 46
Tracking Status
firefox46 --- fixed

People

(Reporter: mconley, Assigned: pbro)

Details

Attachments

(1 file)

STR:

1) Run ./mach mochitest devtools/client/inspector/test/browser_inspector_initialization.js

ER:

The test should run and pass, since it runs and passes in our CI infrastructure.

AR:

I get this failure:

26 INFO TEST-UNEXPECTED-FAIL | devtools/client/inspector/test/browser_inspector_initialization.js | Uncaught exception - at resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/protocol.js:1133 - Error: Can't manage front without an actor ID.
Ensure server supports testActor.
Stack trace:
    Front<.manage@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/protocol.js:1133:13
    exports.TestActorFront<.initialize@http://example.com/browser/devtools/client/shared/test/test-actor.js:564:5
    constructor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/heritage.js:146:23
    getTestActor<@chrome://mochitests/content/browser/devtools/client/shared/test/test-actor-registry.js:100:10
    exports.getTestActorWithoutToolbox<@chrome://mochitests/content/browser/devtools/client/shared/test/test-actor-registry.js:85:10
    Tester_execTest@chrome://mochikit/content/browser-test.js:803:9
    Tester.prototype.nextTest</<@chrome://mochikit/content/browser-test.js:723:7
    SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:741:59
    Tester_execTest@chrome://mochikit/content/browser-test.js:803:9
    Tester.prototype.nextTest</<@chrome://mochikit/content/browser-test.js:723:7
    SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:741:59
SUITE-END | took 5s
I've been investigating this a little bit and I get it now. It indeed works when run as part of the suite because prior tests register the test-actor on the server. 
This particular test does not (it should), but because tests after it have already registered the actor, when it runs in the suite, everything's fine, the server doesn't complain about the actor missing.
This should be an easy fix.
Assignee: nobody → pbrosset
Attachment #8705318 - Flags: review?(poirot.alex) → review+
Comment on attachment 8705318 [details]
MozReview Request: Bug 1237641 - Make sure the test-actor is registered before instantiating the front without a toolbox; r=ochameau

https://reviewboard.mozilla.org/r/29933/#review26995

See my comment, but there shouldn't need another review if try is green and there isn't new exception in the logs.

::: devtools/client/shared/test/test-actor-registry.js:86
(Diff revision 1)
> +  yield registerTestActor(client);

Does that work when running all tests in a raw?
I'm expecting exception to happen as we will register the actor multiple times.
If so, please make registerTestActor a bit smarter by not registering it twice.
I think in registerTestActor, `response` is going to contain `testActor`. In this case return early null. (for now, we don't use the value returned by this function)
(In reply to Alexandre Poirot [:ochameau] from comment #3)
> Does that work when running all tests in a raw?
> I'm expecting exception to happen as we will register the actor multiple
> times.
Right now when running the whole test suite, each and every test calls openInspector which, in turn, calls registerTestActor. So we're already registering actors multiple times and that doesn't seem to cause any problem.
I think there's already an early return in registerActor inside devtools\server\actors\utils\actor-registry-utils.js (using options.prefix) that takes care of this.

My last push to try didn't show any problems related to this change anyway. So let's try and land this to fx-team.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=392fca15bac6
Contains unrelated errors due to a patch that got backed out since.
https://hg.mozilla.org/mozilla-central/rev/593d2794b14e
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46
[bugday-20160323]

Status: RESOLVED,FIXED -> UNVERIFIED

Comments:
STR: Not clear.
Developer specific testing

Component: 
Name			Firefox
Version			46.0b9
Build ID		20160322075646
Update Channel          beta
User Agent		Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
OS			Windows 7 SP1 x86_64

Expected Results: 
Developer specific testing

Actual Results: 
As expected
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.