Repository navigation
test(http): bind port 0 and read the bound address, ending the port race - #74
Merged
Merged
Conversation
The scylla-http tests picked a free port, released it, then passed it to the gateway. A parallel test's gateway could take the port first and answer in its place: http_gateway_token_gates_access then saw 200 from an ungated gateway where it expected 401. scylla-http now announces the address it actually bound, so 127.0.0.1:0 works. A shared tests/common helper starts the gateway on port 0 and reads that line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JMTyE9inRv7Knv6jkmgDZs
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CryptoJones
added a commit
that referenced
this pull request
Oct 24, 2026
…ng the port race (#76) The scylla-rpc, scylla-graphql and scylla-serve tests picked a free port, released it, then passed it to the server. A parallel test's server could take the port first and answer in its place: connection_cap_refuses_the_surplus_connection then reached an uncapped server and got success where it expected a refusal. scylla-graphql and scylla-serve now announce the address they actually bound, so port 0 works (scylla-rpc-serve already printed listener.local_addr()). Each crate gets a shared tests/common helper that starts the server on port 0 and reads the address from its startup line, the same way #74 fixed scylla-http. Claude-Session: https://claude.ai/code/session_01JMTyE9inRv7Knv6jkmgDZs Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes the flaky
http_gateway_token_gates_accessfailure seen on #73.Cause: each
scylla-httptest picked a free port withTcpListener::bind("127.0.0.1:0"), released it, then passed it to the gateway. In that gap a parallel test's gateway could take the same port. The token test then reached an ungated gateway and got 200 where it expected 401. This was a test race, not an auth bug.Fix:
scylla-httpannounces the address it actually bound (server.server_addr()), so127.0.0.1:0works and the startup line shows the real port.tests/commonhelper starts the gateway on port 0, reads that line, and keeps stderr drained.api.rs,conformance.rsandtls.rsuse it.Clippy (
-D warnings) is clean, andcargo test -p scylla-httppassed three runs in a row on ronin28.The same free-port pattern is in
scylla-graphql,scylla-rpcandscylla-servetests. This PR doesn't change those.Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/
🤖 Generated with Claude Code
https://claude.ai/code/session_01JMTyE9inRv7Knv6jkmgDZs