Skip to content

tests.unit.test_flow.TestInstalledAppFlow: test_run_local_server_code_verifier failed #302

Closed
@flaky-bot

Description

@flaky-bot

Note: #243 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: a49216b
buildURL: Build Status, Sponge
status: failed

Test output
self = 
webbrowser_mock = 
instance = 
mock_fetch_token = , port = 60603
@pytest.mark.webtest
@mock.patch("google_auth_oauthlib.flow.webbrowser", autospec=True)
def test_run_local_server_code_verifier(
    self, webbrowser_mock, instance, mock_fetch_token, port
):
    auth_redirect_url = urllib.parse.urljoin(
        f"http://localhost:{port}", self.REDIRECT_REQUEST_PATH
    )
    instance.code_verifier = "amanaplanacanalpanama"

    with concurrent.futures.ThreadPoolExecutor(max_workers=1) as pool:
        future = pool.submit(
            partial(
                instance.run_local_server,
                port=port,
                redirect_uri_trailing_slash=False,
            )
        )

        while not future.done():
            try:
                requests.get(auth_redirect_url)
            except requests.ConnectionError:  # pragma: NO COVER
                pass
      credentials = future.result()

tests/unit/test_flow.py:342:


/usr/local/lib/python3.11/concurrent/futures/_base.py:449: in result
return self.__get_result()
/usr/local/lib/python3.11/concurrent/futures/_base.py:401: in __get_result
raise self._exception
/usr/local/lib/python3.11/concurrent/futures/thread.py:58: in run
result = self.fn(*self.args, **self.kwargs)
google_auth_oauthlib/flow.py:425: in run_local_server
local_server = wsgiref.simple_server.make_server(
/usr/local/lib/python3.11/wsgiref/simple_server.py:154: in make_server
server = server_class((host, port), handler_class)
/usr/local/lib/python3.11/socketserver.py:456: in init
self.server_bind()
/usr/local/lib/python3.11/wsgiref/simple_server.py:50: in server_bind
HTTPServer.server_bind(self)
/usr/local/lib/python3.11/http/server.py:136: in server_bind
socketserver.TCPServer.server_bind(self)


self = <wsgiref.simple_server.WSGIServer object at 0x7f3ce9a5f510>

def server_bind(self):
    """Called by constructor to bind the socket.

    May be overridden.

    """
    if self.allow_reuse_address and hasattr(socket, "SO_REUSEADDR"):
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    if self.allow_reuse_port and hasattr(socket, "SO_REUSEPORT"):
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
  self.socket.bind(self.server_address)

E OSError: [Errno 98] Address already in use

/usr/local/lib/python3.11/socketserver.py:472: OSError

Metadata

Metadata

Assignees

No one assigned

    Labels

    flakybot: flakyTells the Flaky Bot not to close or comment on this issue.flakybot: issueAn issue filed by the Flaky Bot. Should not be added manually.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions