Closed Bug 1779606 Opened 3 years ago Closed 3 years ago

Intermittent mozilla/tests/webdriver/protocol/marionette_port.py | test_marionette_port[fixed] - ConnectionRefusedError: [Errno 111] Connection refused [Address in use (os error 98)]

Categories

(Remote Protocol :: Marionette, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1785895

People

(Reporter: intermittent-bug-filer, Unassigned)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

Filed by: ccozmuta [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=384377472&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/dZBotHnLRgageDWuBi9N_A/runs/0/artifacts/public/logs/live_backing.log


[task 2022-07-14T16:42:57.214Z] 16:42:57     INFO - STDOUT: PASSED
[task 2022-07-14T16:42:57.321Z] 16:42:57     INFO - STDOUT: =================================== FAILURES ===================================
[task 2022-07-14T16:42:57.322Z] 16:42:57     INFO - STDOUT: _________________________ test_marionette_port[fixed] __________________________
[task 2022-07-14T16:42:57.323Z] 16:42:57     INFO - STDOUT: geckodriver = <function geckodriver.<locals>._geckodriver at 0x7f0d78e379d8>
[task 2022-07-14T16:42:57.323Z] 16:42:57     INFO - STDOUT: port = '2828'
[task 2022-07-14T16:42:57.323Z] 16:42:57     INFO - STDOUT:     @pytest.mark.parametrize("port", ["0", "2828"], ids=["system allocated", "fixed"])
[task 2022-07-14T16:42:57.324Z] 16:42:57     INFO - STDOUT:     def test_marionette_port(geckodriver, port):
[task 2022-07-14T16:42:57.324Z] 16:42:57     INFO - STDOUT:         extra_args = ["--marionette-port", port]
[task 2022-07-14T16:42:57.324Z] 16:42:57     INFO - STDOUT:     
[task 2022-07-14T16:42:57.325Z] 16:42:57     INFO - STDOUT:         driver = geckodriver(extra_args=extra_args)
[task 2022-07-14T16:42:57.325Z] 16:42:57     INFO - STDOUT: >       driver.new_session()
[task 2022-07-14T16:42:57.327Z] 16:42:57     INFO - 
[task 2022-07-14T16:42:57.327Z] 16:42:57     INFO - TEST-PASS | /_mozilla/webdriver/protocol/marionette_port.py | test_marionette_port[system allocated] 
[task 2022-07-14T16:42:57.328Z] 16:42:57     INFO - TEST-UNEXPECTED-FAIL | /_mozilla/webdriver/protocol/marionette_port.py | test_marionette_port[fixed] - ConnectionRefusedError: [Errno 111] Connection refused
[task 2022-07-14T16:42:57.328Z] 16:42:57     INFO - geckodriver = <function geckodriver.<locals>._geckodriver at 0x7f0d78e379d8>
[task 2022-07-14T16:42:57.328Z] 16:42:57     INFO - port = '2828'
[task 2022-07-14T16:42:57.329Z] 16:42:57     INFO - 
[task 2022-07-14T16:42:57.329Z] 16:42:57     INFO -     @pytest.mark.parametrize("port", ["0", "2828"], ids=["system allocated", "fixed"])
[task 2022-07-14T16:42:57.329Z] 16:42:57     INFO -     def test_marionette_port(geckodriver, port):
[task 2022-07-14T16:42:57.329Z] 16:42:57     INFO -         extra_args = ["--marionette-port", port]
[task 2022-07-14T16:42:57.329Z] 16:42:57     INFO -     
[task 2022-07-14T16:42:57.329Z] 16:42:57     INFO -         driver = geckodriver(extra_args=extra_args)
[task 2022-07-14T16:42:57.330Z] 16:42:57     INFO - >       driver.new_session()
[task 2022-07-14T16:42:57.330Z] 16:42:57     INFO - 
[task 2022-07-14T16:42:57.330Z] 16:42:57     INFO - driver     = <support.fixtures.Geckodriver object at 0x7f0d78113978>
[task 2022-07-14T16:42:57.330Z] 16:42:57     INFO - extra_args = ['--marionette-port', '2828']
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO - geckodriver = <function geckodriver.<locals>._geckodriver at 0x7f0d78e379d8>
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO - port       = '2828'
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO - 
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO - tests/web-platform/mozilla/tests/webdriver/protocol/marionette_port.py:12: 
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO - tests/web-platform/mozilla/tests/webdriver/support/fixtures.py:252: in new_session
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO -     self.session.start()
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO -         self       = <support.fixtures.Geckodriver object at 0x7f0d78113978>
[task 2022-07-14T16:42:57.331Z] 16:42:57     INFO - tests/web-platform/tests/tools/webdriver/webdriver/client.py:561: in start
<...>
[task 2022-07-14T16:42:57.360Z] 16:42:57     INFO -  ('127.0.0.1', 36136))
[task 2022-07-14T16:42:57.360Z] 16:42:57     INFO - sa         = ('127.0.0.1', 36136)
[task 2022-07-14T16:42:57.360Z] 16:42:57     INFO - sock       = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
[task 2022-07-14T16:42:57.360Z] 16:42:57     INFO - socktype   = <SocketKind.SOCK_STREAM: 1>
[task 2022-07-14T16:42:57.360Z] 16:42:57     INFO - source_address = None
[task 2022-07-14T16:42:57.360Z] 16:42:57     INFO - timeout    = <object object at 0x7f0d802ad160>
[task 2022-07-14T16:42:57.361Z] 16:42:57     INFO - 
[task 2022-07-14T16:42:57.361Z] 16:42:57     INFO - /usr/lib/python3.6/socket.py:713: ConnectionRefusedError
[task 2022-07-14T16:42:57.361Z] 16:42:57     INFO - .
[task 2022-07-14T16:42:57.362Z] 16:42:57     INFO - TEST-OK | /_mozilla/webdriver/protocol/marionette_port.py | took 14008ms

This failed because of:

[task 2022-07-14T16:42:50.042Z] 16:42:50     INFO - STDOUT: Running command: ['/builds/worker/fetches/geckodriver', '--port', '36136', '-vv', '--marionette-port', '2828']
[task 2022-07-14T16:42:50.047Z] 16:42:50     INFO - STDOUT: /builds/worker/fetches/geckodriver: error: Address in use (os error 98)

As it looks like geckodriver was still running so maybe the test didn't wait long enough until the process was closed. Lets observe how often this happens.

Summary: Intermittent mozilla/tests/webdriver/protocol/marionette_port.py | test_marionette_port[fixed] - ConnectionRefusedError: [Errno 111] Connection refused → Intermittent mozilla/tests/webdriver/protocol/marionette_port.py | test_marionette_port[fixed] - ConnectionRefusedError: [Errno 111] Connection refused [Address in use (os error 98)]

I'm also getting this error intermittently in Selenium tests using Firefox in Windows. I don't have any relevant trace about it, sorry. The test fails showing the following:

geckodriver 0.31.0 (b617178ef491 2022-04-06 11:57 +0000) 
WebDriver implementation for Firefox

USAGE:
    geckodriver [OPTIONS]

OPTIONS:
        --allow-hosts <ALLOW_HOSTS>...
            List of hostnames to allow. By default the value of --host is allowed, and in addition
            if that's a well known local address, other variations on well known local addresses are
            allowed. If --allow-hosts is provided only exactly those hosts are allowed.

        --allow-origins <ALLOW_ORIGINS>...
            List of request origins to allow. These must be formatted as scheme://host:port. By
            default any request with an origin header is rejected. If --allow-origins is provided
            then only exactly those origins are allowed.

        --android-storage <ANDROID_STORAGE>
            Selects storage location to be used for test data (deprecated). [possible values: auto,
            app, internal, sdcard]

    -b, --binary <BINARY>
            Path to the Firefox binary

        --connect-existing
            Connect to an existing Firefox instance

    -h, --help
            Prints this message

        --host <HOST>
            Host IP to use for WebDriver server [default: 127.0.0.1]

        --jsdebugger
            Attach browser toolbox debugger for Firefox

        --log <LEVEL>
            Set Gecko log level [possible values: fatal, error, warn, info, config, debug, trace]

        --marionette-host <HOST>
            Host to use to connect to Gecko [default: 127.0.0.1]

        --marionette-port <PORT>
            Port to use to connect to Gecko [default: system-allocated port]

    -p, --port <PORT>
            Port to use for WebDriver server [default: 4444]

    -v
            Log level verbosity (-v for debug and -vv for trace level)

    -V, --version
            Prints version and copying information

        --websocket-port <PORT>
            Port to use to connect to WebDriver BiDi [default: 9222]

/home/runner/.cache/selenium/geckodriver/linux64/0.31.0/geckodriver: error: Address in use (os error 98)
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE

Not sure if it helps, but I managed to gather the geckodriver profiler data (using the env MOZ_PROFILER_SHUTDOWN=geckodriver-profile.json) for a test execution in which the above-mentioned error (error: Address in use (os error 98)) happens. Here you are.

(In reply to boni.garcia from comment #7)

Not sure if it helps, but I managed to gather the geckodriver profiler data (using the env MOZ_PROFILER_SHUTDOWN=geckodriver-profile.json) for a test execution in which the above-mentioned error (error: Address in use (os error 98)) happens. Here you are.

Sadly the profiler data is not helpful in such a case. Instead it would be good to know why the address is still in use.

Moving bug to Remote Protocol::Marionette component per bug 1815831.
Component: geckodriver → Marionette
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: