Closed Bug 1530979 Opened 10 months ago Closed 9 months ago

Send custom "marionette-startup-requested" observer notification to start Marionette in Firefox and Fennec

Categories

(Firefox :: General, enhancement, P1)

65 Branch
enhancement

Tracking

()

RESOLVED FIXED
Firefox 67
Tracking Status
firefox67 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(3 files)

As of now Marionette listens for a couple of startup observer notifications, and has to wait until the startup recorder has finished recording startup scripts:

https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/testing/marionette/components/marionette.js#449-456

For Fennec and GeckoView we recently got the marionette-startup-requested observer notification added (see bug 1496773), which allows us to explicitly specify at which stage during startup Marionette has to be enabled.

The same behavior we would like to see for Firefox.

Florian and Gijs, where would be the best place to send this notification?

I also hope that with this change we can finally resolve bug 1382162.

Flags: needinfo?(gijskruitbosch+bugs)
Flags: needinfo?(florian)

So which problem are you actually trying to fix here? Waiting until startup is finished (which is what is done by waiting until startup recorder is done recording) seems correct.

Bug 1382162 seems to be Firefox failing to fully startup for unclear reasons. Using another notification for marionette would likely just result in the tests failing in another way.

Flags: needinfo?(florian)

What we want is a unique entry point across all supported applications, which can be used to signal Marionette to initialize itself. As of now for each application different behavior has to be implemented, which causes a lot of spaghetti code in Marionette and makes that code very hard to read/follow. And there will be even more applications in the future...

Summary: Send custom "marionette-startup-requested" observer notification to start Marionette → Send custom "marionette-startup-requested" observer notification to start Marionette in Firefox

If you are looking for a place in Firefox code from which you could fire a marionette-startup-requested notification, that would likely be at the end of _scheduleStartupIdleTasks https://searchfox.org/mozilla-central/rev/dbddac86aadf1d4871fb350bbe66db43728a9f81/browser/components/BrowserGlue.jsm#1607

I think Florian's answered this.

Flags: needinfo?(gijskruitbosch+bugs)

So in the startup code of Marionette we also have to handle the gfx sanity check window. I tried to find out when exactly this is called but I cannot get it. Florian, do you know if by the time when the end of _scheduleStartupIdleTasks is reached, this window has already been closed?

Flags: needinfo?(florian)

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] (away 02/28 - 03/03) from comment #5)

So in the startup code of Marionette we also have to handle the gfx sanity check window. I tried to find out when exactly this is called but I cannot get it.

profile-after-change, if the version changed, see https://searchfox.org/mozilla-central/source/toolkit/components/gfx/SanityTest.jsm#371

Florian, do you know if by the time when the end of _scheduleStartupIdleTasks is reached, this window has already been closed?

There's no guarantee, I think.

Flags: needinfo?(florian)

Thanks Gijs. In that case I think the best would be to have a way to disable the GFX sanity window, which is even not that helpful for when running tests (see bug 1420864 comment 2).

Depends on: 1420864

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #7)

Thanks Gijs. In that case I think the best would be to have a way to disable the GFX sanity window, which is even not that helpful for when running tests (see bug 1420864 comment 2).

You could do that by just setting the prefs that it uses to check if the version/buildid changed to be the same as the version/buildid you're running, before starting firefox.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Priority: P3 → P1

Given that I don't have that much time in the next week we will just land the minimum amount of code to make the request via this bug a reality. Anything related to the GFX sanity window will be followed-up on later via bug 1420864.

Depends on: 1534635

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #0)

For Fennec and GeckoView we recently got the marionette-startup-requested observer notification added (see bug 1496773), which allows us to explicitly specify at which stage during startup Marionette has to be enabled.

Looks like I was wrong for Fennec. The recent try shows timeouts on this platform for each job. I filed bug 1534635, which needs to be implemented first.

Duplicate of this bug: 1534635

It turned out I cannot patch only Fennec first without having to add workarounds. As such lets do both Firefox and Fennec in the same patch series. For details see bug 1534635 comment 6.

Summary: Send custom "marionette-startup-requested" observer notification to start Marionette in Firefox → Send custom "marionette-startup-requested" observer notification to start Marionette in Firefox and Fennec
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bdbfe0cf3358
Send custom "marionette-startup-requested" observer notification to start Marionette in Firefox. r=florian
https://hg.mozilla.org/integration/autoland/rev/3d6d57a8d3d9
Send custom "marionette-startup-requested" observer notification to start Marionette in Fennec. r=snorp
https://hg.mozilla.org/integration/autoland/rev/e79f9f619f03
[marionette] Initialize Marionette when receiving the `marionette-startup-requested` notification. r=florian,automatedtester
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
You need to log in before you can comment on or make changes to this bug.