Skip to content

Close VXI-11 discovery sockets - #671

Merged
MatthieuDartiailh merged 2 commits into
pyvisa:mainfrom
CAOShurong:codex/507-discovery-socket-cleanup
Oct 13, 2026
Merged

MatthieuDartiailh merged 2 commits into
pyvisa:mainfrom
CAOShurong:codex/507-discovery-socket-cleanup

Conversation

@CAOShurong

Copy link
Copy Markdown
Contributor

VXI-11 discovery creates a UDP port-mapper client for each interface but leaves their sockets to garbage collection. Calling ResourceManager("@py").list_resources() on current main produces an unclosed-socket ResourceWarning.

Keep all created clients until a finally cleanup, including clients whose broadcast fails, while preserving successful discovery results. The regression covers successful discovery and both send and receive errors.

Related to #507. Its original asyncio traceback was not reproduced; this fixes the separate socket-lifecycle problem found through the same discovery entry point.

  • Executed pre-commit with no errors
  • Added automated regression coverage
  • Added a CHANGES entry

Validation: 309 passed, 160 skipped; strict Sphinx build and installed-wheel discovery checks passed. Physical instruments were not tested. No protocol-compliance changes.

Signed-off-by: CAOShurong <170531907+CAOShurong@users.noreply.github.com>
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.33%. Comparing base (eee01cc) to head (8ea3251).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #671      +/-   ##
==========================================
+ Coverage   54.74%   55.33%   +0.59%     
==========================================
  Files          39       39              
  Lines        6518     6549      +31     
  Branches      649      652       +3     
==========================================
+ Hits         3568     3624      +56     
+ Misses       2854     2827      -27     
- Partials       96       98       +2     
Flag Coverage Δ
unittests 55.33% <100.00%> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MatthieuDartiailh
MatthieuDartiailh merged commit fcbe7f5 into pyvisa:main Oct 13, 2026
18 checks passed
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

Successfully merging this pull request may close these issues.

2 participants