Closed Bug 2040974 Opened 5 months ago Closed 2 months ago

Use a custom exit code in "Services.appstartup.quit()" when Marionette or RemoteAgent fail to start their server

Categories

(Remote Protocol :: Agent, task, P3)

task

Tracking

(firefox156 fixed)

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: whimboo, Assigned: khalid.alhaddad98, Mentored)

Details

(Whiteboard: [webdriver:m21][webdriver:external][lang=js][webdriver:relnote])

Attachments

(1 external file)

Both components currently call Services.appstartup.quit() without a custom error code. As such the process quits with an exit code of 0 which is inappropriate. We should use 69 similar to geckodriver when the port is not available.

Mentor: hskupin
Priority: -- → P3
Whiteboard: [webdriver:backlog][lang=js]
Assignee: nobody → khalid.alhaddad98

Hi Khalid. Sorry for the delay in my response but the bug notification got under the wire due to the massive amount of bug mail I receive per day. And sadly pushing to Phabricator with WIP set, doesn't send out emails as well. :( So if you don't get a reply within 2 days please feel free to set needinfo for me in the future.

I have taken a look at the patch now and I can see the problem. The second instance of Marionette will fail on the same port because there is already an active session. I think what we need to do here is actually the following:

  1. Use mozrunner directly or a new instance of GeckoInstance purely to create a new Firefox process. It should use Marionette on a fixed host/port.
  2. Create a new Marionette instance for the same host/port configuration, and let it launch its own Firefox process. Given that this is using the same port, Firefox should terminate itself because it cannot create the server.
  3. Marionette should detect that the Firefox process shutdown and we need to check the exit code.

Let me know if you need further assistance, but based on your earlier message on Matrix you might be fine in playing with the above steps.

Hi whimboo, no worries, and sure I will send a needinfo in the future. I will also have a look at using either the mozrunner or a new instance of GeckoInstance, but I will let you know as usual if I have any questions.

Attachment #9597886 - Attachment description: WIP: Bug 2040974 - Use a custom exit code in "Services.appstartup.quit()" when Marionette or RemoteAgent fail to start their server. r?whimboo → Bug 2040974 - Use a custom exit code in "Services.appstartup.quit()" when Marionette or RemoteAgent fail to start their server. r?whimboo
Attachment #9597886 - Attachment description: Bug 2040974 - Use a custom exit code in "Services.appstartup.quit()" when Marionette or RemoteAgent fail to start their server. r?whimboo → Bug 2040974 - [remote] Use a custom exit code when Marionette or RemoteAgent fail to start their server. r?whimboo
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2f9db142371f https://hg.mozilla.org/integration/autoland/rev/40b8b88dd939 [remote] Use a custom exit code when Marionette or RemoteAgent fail to start their server. r=whimboo
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
Whiteboard: [webdriver:backlog][lang=js] → [webdriver:21][webdriver:external][lang=js]
Whiteboard: [webdriver:21][webdriver:external][lang=js] → [webdriver:m21][webdriver:external][lang=js]

Thank you Khalid for getting this bug fixed! I meanwhile as well fixed the Windows issue so that the newly added test now also works on that platform.

I wonder if you might be interested to work on bug 2044153 next. It's more JS but it would be good to see aligned between Marionette and BiDi. Also let me know if you need help when pushing a patch to try for verification. Thanks!

Flags: needinfo?(khalid.alhaddad98)

That is good to hear, and yes, I'd be happy to work on bug 2044153, and as always will let you know if I run into any issues with my try push.

Thanks in advance.

Flags: needinfo?(khalid.alhaddad98)
Whiteboard: [webdriver:m21][webdriver:external][lang=js] → [webdriver:m21][webdriver:external][lang=js][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: