Replace fixed integration ports with ephemeral allocated ports#732
Merged
Timi16 merged 3 commits intoTimi16:mainfrom Mar 29, 2026
Conversation
|
@teeschima Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #656
Fantastic news: the tests now use ephemeral ports, and everything passes as expected.
Your code is now robust against shared/dev test port collisions.
🔧 What I changed
mod.rs
Added allocate_ephemeral_port():
Bind 127.0.0.1:0
Read local_addr().port()
Drop listener and return port
remote_run_tests.rs
Added mod network;
Replaced hardcoded 9245 with:
let port = network::allocate_ephemeral_port().expect("...");
server: --port using port.to_string()
client ping and run target use 127.0.0.1:{port}
parity_tests.rs
Replaced static ports 19_230, 19_231 with network::allocate_ephemeral_port() for both DAP tests.
🧪 Tests run
cargo test --workspace --all-features --tests -- --test-threads=8
cargo test --test remote_run_tests -- --test-threads=8
cargo test --test parity_tests -- --test-threads=8
All passed:
remote_run_tests: 1 passed
parity_tests: 17 passed
📌 Acceptance criteria status
Network tests reserve free ports dynamically: implemented
Pass selected port through test setup: done (port variable passed to server/client)
No fixed integration ports left: verified via grep
Parallel tests: no collision: pass confirmed in test environment