Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OS-picked ports in the cli.rs tests #150

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RNabel
Copy link
Contributor

@RNabel RNabel commented Aug 17, 2024

Starts #37 by using dynamically picked ports in the cli tests.

This PR:

  1. Let's the OS pick a free port by starting up a temporary TCP server against port 0 and checking which port it took.
  2. Creates a shim around the Child + port to avoid passing around (Child, port) tuples.

This way of getting a port isn't 100% reliable but the alternatives of e.g. having the node print its IP/port to stdout and then parsing it felt worse. Happy to make changes if you have other ideas!

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.

1 participant