Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_multiple_bind_addresses_port_forward appears to hang and fails (Macbook M3) #380

Open
marcodlk opened this issue May 17, 2024 · 1 comment
Labels
bug Something isn't working os/mac Specific to macOS tests

Comments

@marcodlk
Copy link
Contributor

Which project are you reporting a bug for?

kr8s

What happened?

I've been running pytest kr8s/tests -k "not test_multiple_bind_addresses_port_forward" to test because that test function appears to hang and eventually fails. I am on a Macbook M3.

❯ uname -a
Darwin laptop-D96560.home 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:37 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6031 arm64

Anything else?

No response

@marcodlk marcodlk added the bug Something isn't working label May 17, 2024
@jacobtomlinson jacobtomlinson added tests os/mac Specific to macOS labels May 20, 2024
@jacobtomlinson
Copy link
Member

jacobtomlinson commented May 20, 2024

I am able to reproduce this on my M3 MacBook (I typically develop kr8s on a Ubuntu machine though).

future: <Task finished name='Task-55' coro=<PortForward.start.<locals>.f() done, defined at /Users/jtomlinson/Projects/kr8s-org/kr8s/kr8s/_portforward.py:122> exception=OSError("could not bind on any address out of [('127.0.0.2', 28235)]")>
Traceback (most recent call last):
  File "/Users/jtomlinson/Projects/kr8s-org/kr8s/kr8s/_portforward.py", line 124, in f
    async with self as port:
  File "/Users/jtomlinson/Projects/kr8s-org/kr8s/kr8s/_portforward.py", line 112, in __aenter__
    return await self._run_task.__aenter__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jtomlinson/miniconda3/envs/kr8s/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jtomlinson/Projects/kr8s-org/kr8s/kr8s/_portforward.py", line 159, in _run
    server = await asyncio.start_server(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jtomlinson/miniconda3/envs/kr8s/lib/python3.11/asyncio/streams.py", line 84, in start_server
    return await loop.create_server(factory, host, port, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jtomlinson/miniconda3/envs/kr8s/lib/python3.11/asyncio/base_events.py", line 1539, in create_server
    raise OSError('could not bind on any address out of %r'
OSError: could not bind on any address out of [('127.0.0.2', 28235)]

We don't actually test Windows or Mac in CI so we can't really guarentee support. But I'd like to change that so I've opened #382 to track adding this.

Given this particular error happens when starting an asyncio server I suspect this error will either go away or change once #333 has been implemented. Therefore I suggest we prioritise that issue and then come back here once it is done and see what state things are in.

In the meantime we should probably just skip that test on Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os/mac Specific to macOS tests
Projects
None yet
Development

No branches or pull requests

2 participants