microsoft / microsoft/Qcodes

Warnings about non closes sockets on windows during test suite

Open
#6,501 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

Run the test suite and you will see warnings like

```
Exception ignored in:
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
```

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
```

Contributor guide

Open the contributing guide

Research direction

Run the provided no-op Hypothesis test on Windows with pytest-xdist enabled and confirm the unclosed-socket warning. Trace the interaction between pytest-xdist and Hypothesis, then verify that the test suite completes without ResourceWarning messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.