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

Some local tests may fail if port number is not available #97

Closed
2 of 3 tasks
davebryson opened this issue May 1, 2022 · 2 comments
Closed
2 of 3 tasks

Some local tests may fail if port number is not available #97

davebryson opened this issue May 1, 2022 · 2 comments
Assignees
Labels
enhancement/testing Increases test coverage or quality fix/bug Fixes errant behavior

Comments

@davebryson
Copy link
Contributor

Affected Branch

trunk

Basic Diagnostics

  • I've pulled the latest changes on the affected branch and the issue is still present.

  • The issue is reproducible in docker

Description

Testing outside of Docker may fail if a port number is needed for the test and the port is in use. In some cases, this may result in a seg fault which can be misleading. For example, the unit tests in raft_test.app create 3 nodes using the port range 5000-5002. The port range has caused seg faults on my machine as port 5000 was in use. Changing the ports resolves the issue.

I'm not sure what the best fix for this is. Finding available ports (in code) can be a little tricky and unreliable. The other alternative is to just test in Docker and specify that testing outside of Docker is not recommended....

Code of Conduct

  • I agree to follow this project's Code of Conduct
@davebryson davebryson added the fix/bug Fixes errant behavior label May 1, 2022
@davebryson davebryson changed the title some local test may fail if port number is not available some local tests may fail if port number is not available May 1, 2022
@davebryson davebryson changed the title some local tests may fail if port number is not available Some local tests may fail if port number is not available May 1, 2022
@HalosGhost
Copy link
Collaborator

I've run into this before, and we do have one potential solution for it housed under #3 (particularly in the task Add support for OS-assigned ephemeral port numbers and leverage them in-tests).

It should be possible to listen on port 0 (which should fetch an available port).

@HalosGhost HalosGhost added the enhancement/testing Increases test coverage or quality label May 2, 2022
@HalosGhost HalosGhost removed their assignment May 2, 2022
@maurermi maurermi self-assigned this Jul 18, 2024
@HalosGhost
Copy link
Collaborator

via #289.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement/testing Increases test coverage or quality fix/bug Fixes errant behavior
Projects
None yet
Development

No branches or pull requests

3 participants