Repository navigation
tests: start every server test on a free port - #36
Merged
Merged
Conversation
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), test_server.py (the fixed 2480 and 8080 become free ports, the asserts compare against the chosen port, and test_server_context_manager gets one too), test_server_packaging.py and test_server_http_endpoints.py.
Port of humemai/arcadedb-embedded-python#466.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of humemai/arcadedb-embedded-python#466 (merged there). Based on
main.The server's default HTTP port is the fixed 2480, so any test that starts a server without choosing a port fails with "Unable to listen to a HTTP port in the configured port range 2480 - 2480" whenever anything else on the machine holds 2480. Every test that starts a server on the default or a fixed port now passes
config={"http_port": free_port()}, with onefree_port()helper intests/conftest.py(the wire-protocol tests keep their own_free_ports, which hands out several distinct ports at once; this also follows the "never address a hand-picked port" rule in CLAUDE.md). Touchestest_server_patterns.py(all six servers),test_server.py(the fixed 2480 and 8080 become free ports and the asserts compare against the chosen port),test_server_packaging.pyandtest_server_http_endpoints.py.Differences from the original:
test_server_context_managerintest_server.pyalso started a server on the default port and was missed there, so it is fixed here. The original'sservedfixture intest_server_packaging.pydoes not exist onmainyet.Checked locally with a dummy listener holding
0.0.0.0:2480, on the released 26.10.2 linux x86_64 cp312 wheel (the tests do not depend on the unreleased engine), pinnedtaskset -c 0-3, JVM-Xmx2g:test_server.py,test_server_patterns.py,test_server_http_endpoints.pyandtest_server_packaging.py::test_server_starts_and_serves_http: 17 passed. The same run on unfixedmain(withouttest_server_patterns.py): 4 failed, 4 errors.pre-commit(black, isort) passes. The wire-protocol tests were not touched and not run.Possible conflicts: #28 edits
tests/test_server_packaging.pybelowtest_server_starts_and_serves_http(adds aservedfixture that starts a server on the default port, so it needsconfig={"http_port": free_port()}once both are in), and #20 edits the top of the same file; #29 editstests/conftest.pynear the top (imports), not nearTEST_PASSWORD. I expect textual merges to be clean except possibly the import line intest_server_packaging.py.🤖 Generated with Claude Code