Skip to content

Replace fixed integration ports with ephemeral allocated ports#732

Merged
Timi16 merged 3 commits intoTimi16:mainfrom
teeschima:Replace-fixed-integration-ports-with-ephemeral-allocated-ports
Mar 29, 2026
Merged

Replace fixed integration ports with ephemeral allocated ports#732
Timi16 merged 3 commits intoTimi16:mainfrom
teeschima:Replace-fixed-integration-ports-with-ephemeral-allocated-ports

Conversation

@teeschima
Copy link
Copy Markdown
Contributor

@teeschima teeschima commented Mar 29, 2026

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

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@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! 🚀

Learn more about application limits

@Timi16 Timi16 merged commit 292e6a8 into Timi16:main Mar 29, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remote tests: Replace fixed integration ports with ephemeral allocated ports

2 participants