982d02faef3f (bug 777145) breaks Marionette on B2G

RESOLVED FIXED

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jgriffin, Unassigned)

Tracking

Trunk
All
Gonk (Firefox OS)
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking-basecamp:+)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Created attachment 657116 [details]
logcat

changeset http://hg.mozilla.org/mozilla-central/rev/982d02faef3f breaks Marionette on B2G.  With this changeset, Marionette opens its port as usual, but then it gets closed immediately.

Marionette on desktop Firefox is not affected.  This problem goes away if I back out this change.

Logcat (with some extra debugging added):

I/Gecko   (   42): DBG-SERVER: Got: {"to": "root", "type": "getMarionetteID"}
I/Gecko   (   42): DBG-SERVER: Cleaning up connection. 
I/Gecko   (   42): DBG-SERVER: JS frame :: chrome://global/content/devtools/dbg-transport.js :: DT_onStopRequest :: line 117
I/Gecko   (   42): 
I/Gecko   (   42): getActor: JS frame :: chrome://global/content/devtools/dbg-server.js :: DSC_onPacket :: line 432
E/GeckoConsole(   42): [JavaScript Error: "this._actorPool is null" {file: "chrome://global/content/devtools/dbg-server.js" line: 406}]

Full logcat attached.

It looks like something is closing Marionette's socket.

This blocks all B2G automated testing.
(Reporter)

Updated

6 years ago
blocking-basecamp: --- → ?
Oof, terrible. This is why we need Marionette results in TBPL asap.

That said, the patch works on the device, so this is just an emulator issue, likely due to the fact that the emulator has neither Wifi nor 3G data enabled. I'll try to take a look tomorrow, maybe we can fake something here.
Not blocking, as in if we were shipping tomorrow we wouldn't hold the release for this. But this needs fixed either way, of course.
blocking-basecamp: ? → -
I tried putting

  // Ensure we're not in offline mode. On B2G, for instance, the mobile
  // data and wifi network interfaces have an effect on offline mode
  // causes the emulator to be offline by default.
  function ensureOnline() {
    dump("Disabling offline mode for tests\n".);
    Services.io.offline = false;
  }
  const TOPIC_INTERFACE_REGISTERED   = "network-interface-registered";
  const TOPIC_INTERFACE_UNREGISTERED = "network-interface-unregistered";
  Services.obs.addObserver(ensureOnline, TOPIC_INTERFACE_REGISTERED, false);
  Services.obs.addObserver(ensureOnline, TOPIC_INTERFACE_UNREGISTERED, false);
  ensureOnline();

in marionette-actors.js but for some reason it didn't help. I don't have enough time to track this down, so I'm just going to back out bug 777145 for now until we have a fix.
I'm re-building with the backout in place. I'm also seeing this:

  E/GeckoConsole(   41): [JavaScript Error: "this._actorPool is null" {file: "chrome://global/content/devtools/dbg-server.js" line: 407}]

in the logcat... Could it be related?
Bug 777145 has been backed out. Once the Marionette tests go green again, we should close this bug and discuss the fix in bug 777145.
(Reporter)

Comment 6

6 years ago
(In reply to Philipp von Weitershausen [:philikon] from comment #4)
> I'm re-building with the backout in place. I'm also seeing this:
> 
>   E/GeckoConsole(   41): [JavaScript Error: "this._actorPool is null" {file:
> "chrome://global/content/devtools/dbg-server.js" line: 407}]
> 
> in the logcat... Could it be related?

That error occurs because something closes the socket prematurely, which causes the remote debugger to clean up the actor pool by deleting it.  When this happens while the remote debugger is in the midst of processing a message from Marionette, you get that error.
(Reporter)

Comment 7

6 years ago
The backout of 982d02faef3f fixed this problem.  Results after the backout:

SUMMARY
-------
passed: 57
failed: 42
todo: 0

All the failures are due to an unrelated problem I'm investigating now.
Status: NEW → RESOLVED
blocking-basecamp: - → ?
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Reporter)

Updated

6 years ago
Blocks: 777145
We wouldn't want to ship without Marionette tests running so marking as a blocker.
blocking-basecamp: ? → +
You need to log in before you can comment on or make changes to this bug.