Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.

tests: start every server test on a free port - #466

Merged
tae898 merged 1 commit into
mainfrom
fix-test-free-port
Oct 22, 2026
Merged

tae898 merged 1 commit into
mainfrom
fix-test-free-port

Conversation

@tae898

@tae898 tae898 commented Oct 22, 2026 •

Copy link
Copy Markdown

Fixes #464

Every test that starts a server on the default or a fixed port now passes config={"http_port": free_port()}, with one free_port() helper in tests/conftest.py (the wire-protocol tests keep their own _free_ports, which hands out several distinct ports at once). Touches test_server_patterns.py (all six servers, including test_embedded_performance_comparison and test_http_api_access_pattern), test_server.py (the fixed 2480 and 8080 become free ports and the asserts compare against the chosen port), test_server_packaging.py and test_server_http_endpoints.py.

Draft until the run below is in: the four files are queued behind other jobs in quiet_build.sh, once with a dummy listener holding 0.0.0.0:2480 to prove the fix. Results will be added here.

🤖 Generated with Claude Code

Server tests that used the default or a fixed port failed when anything else held 2480. A free_port() helper in conftest picks one per test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tae898

tae898 commented Oct 22, 2026

Copy link
Copy Markdown
Author

Ran the four server test files with port 2480 held by a dummy listener for the whole run: ============================= 21 passed in 16.33s ==============================. Before this change, tests on the fixed port failed with "Unable to listen to a HTTP port in the configured port range 2480 - 2480" whenever 2480 was taken.

@tae898
tae898 marked this pull request as ready for review October 22, 2026 05:22
@tae898
tae898 merged commit fe4aa86 into main Oct 22, 2026
15 checks passed
@tae898
tae898 deleted the fix-test-free-port branch October 22, 2026 05:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server tests start on the fixed port 2480 and fail when something else holds it

1 participant