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

Warnings about non closes sockets on windows during test suite #6501

Open
jenshnielsen opened this issue Oct 8, 2024 · 1 comment
Open

Comments

@jenshnielsen
Copy link
Collaborator

Run the test suite and you will see warnings like

Exception ignored in: <socket.socket fd=1088, family=2, type=1, proto=0, laddr=('127.0.0.1', 56248), raddr=('127.0.0.1', 56249)>
Traceback (most recent call last):
  File "C:\Users\jenielse\AppData\Roaming\uv\data\python\cpython-3.12.7-windows-x86_64-none\Lib\threading.py", line 1016, in run
    del self._target, self._args, self._kwargs
                      ^^^^^^^^^^
ResourceWarning: unclosed <socket.socket fd=1088, family=2, type=1, proto=0, laddr=('127.0.0.1', 56248), raddr=('127.0.0.1', 56249)>

A bit of digging seems to indicate that this relates to a combination of pytest-xdist and hypothesis.

The following no-op test triggers the warning when run using xdist with n > 0

import hypothesis.strategies as hst
from hypothesis import given


@given(n_points_pws=hst.integers(min_value=1, max_value=500))
def test_pytest_min_warning(
    n_points_pws,
) -> None:
    pass
@jenshnielsen
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant