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

LocalPortCheckerTest fails when SSH port (22) is NOT actually in use #475

Closed
sleberknight opened this issue Dec 8, 2020 · 0 comments · Fixed by #476
Closed

LocalPortCheckerTest fails when SSH port (22) is NOT actually in use #475

sleberknight opened this issue Dec 8, 2020 · 0 comments · Fixed by #476
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sleberknight
Copy link
Member

sleberknight commented Dec 8, 2020

We made a poor assumption in LocalPortCheckerTest#testIsPortAvailable_WherePortIsNotAvailable which is that the default SSH port 22 is always available. Well, turns out that's not always the case. For example, on my other MacBook Pro I have Remote Login disabled, and therefore port 22 is not enabled.

So, we should determine a better way to do this, e.g. use the Dropwizard test extensions to spin up a small application running in Jetty, get its port, and use that when calling the isPortAvailable method in the test.

@sleberknight sleberknight added the bug Something isn't working label Dec 8, 2020
@sleberknight sleberknight self-assigned this Dec 8, 2020
@sleberknight sleberknight added this to the 0.18.0 milestone Dec 8, 2020
sleberknight added a commit that referenced this issue Dec 8, 2020
* Instead, just open a ServerSocket on a random port and use its
  port as the "in use" port. Simple and no assumptions.
* Minor update to the failure description in another test to make it
  more clear that we are intentionally halting a test
* Change several tests to use JUnit Jupiter @ParameterizedTest and
  added/updated failure description messages

LocalPortChecker:
* Add port to exception message thrown by findFirstOpenPortAbove method

Fixes #475
chrisrohr pushed a commit that referenced this issue Dec 8, 2020
* Instead, just open a ServerSocket on a random port and use its
  port as the "in use" port. Simple and no assumptions.
* Minor update to the failure description in another test to make it
  more clear that we are intentionally halting a test
* Change several tests to use JUnit Jupiter @ParameterizedTest and
  added/updated failure description messages

LocalPortChecker:
* Add port to exception message thrown by findFirstOpenPortAbove method

Fixes #475
Closes #477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant