Repository navigation
test(tcp): give the TCP service its own free port, not the HTTP port + 1 - #312
Merged
Merged
Conversation
Two raw-TCP contract tests derived the TCP service port as the HTTP port
plus one and never checked it was free. On a busy CI runner it sometimes
was not: the framework correctly refused it ("tcp_service 'trackers' port
48444 is already bound by another worker -- single-owner, this worker will
not bind") and the readiness wait ran out after 25s ("child server never
became ready"). Seen on tina4-python#311, whose change does not touch TCP.
_tcp_port_env() takes a real free_port() per boot attempt (never the HTTP
port itself) and hands the readiness check and the client the same one.
Test-only; the framework's single-owner behaviour is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Tina4 <82961293+tina4stack@users.noreply.github.com>
Signed-off-by: Andre van Zuydam <andrevanzuydam@gmail.com>
Merged
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.
Flake.
test_listen_accept_in_process_while_http_still_servesfailed on tina4-python#311, whose change never touches TCP:Both raw-TCP contract tests set
TINA4_TCP_PORTto the HTTP port plus one and never checked that port was free. When something on the runner held it, the framework did the right thing and refused to bind, and the readiness wait for that port timed out.Fix (test-only).
_tcp_port_env()allocates the TCP port with the suite's ownfree_port()on every boot attempt (never the HTTP port itself) and hands the same port to the readiness check and the client. The framework's single-owner behaviour is unchanged.Checks. The file collects (21 tests).
ruffreports the same 12 findings asv3(E702 semicolons, none on changed lines), so this change adds none. These tests need POSIX process groups, so CI on Linux is where they run; this PR's CI is the proof.🤖 Generated with Claude Code