Closed Bug 1528836 Opened 5 years ago Closed 5 years ago

Allow "check_port_available()" to raise socket errors

Categories

(Remote Protocol :: Marionette, enhancement, P2)

enhancement

Tracking

(firefox66 fixed, firefox67 fixed)

RESOLVED FIXED
mozilla67
Tracking Status
firefox66 --- fixed
firefox67 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

Attachments

(1 file)

Currently we hide the error as raised by socket.bind() inside of is_port_available because this method is only allowed to return a boolean.

It would be better to allow this method to raise an error, so it can be re-used in calling code for better error messages.

We would need that to easier analyze what's happening on bug 1527963.

Lets make the initial request part of the more pressing one. As noticed when using ncap locally and keeping the port 2828 in use, Marionette didn't detect that and happily started Firefox. But then it was failing to connect to the server, and instead connected to ncap which times out after 120s.

So the initial port probe shouldn't make use of "SO_REUSEADDR".

Status: NEW → ASSIGNED
Summary: Allow "is_port_available()" to raise socket errors → Don't use "SO_REUSEADDR" when probing for an available port

We actually cannot remove this socket option because it would result in failures for restart tests. As such lets try to keep this bug simple and only make the check_port_available method more verbose.

Summary: Don't use "SO_REUSEADDR" when probing for an available port → Allow "check_port_available()" to raise socket errors
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/81945490d433
[marionette] Allow check_for_port to raise exceptions. r=automatedtester
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

Is this something you intend for beta uplift?

Flags: needinfo?(hskupin)

Yes, for failure inspection it would be great to have this test-only patch uplifted to beta.

Flags: needinfo?(hskupin)
Whiteboard: [checkin-needed-beta]

Can you request uplift.... or just land it :)

Flags: needinfo?(hskupin)
Whiteboard: [checkin-needed-beta]
Flags: needinfo?(hskupin)
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: