-
Notifications
You must be signed in to change notification settings - Fork 184
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
Fix Port Binding Issue During Testing #382
Conversation
@neeetman What problem is this trying to solve in testing? If the port is in use, then the test environment is wrong not the code. |
Each test requires applying for a new port. However, sometimes other services running on the server might already be occupying that port. It might be better to consider skipping the occupied ports instead of directly terminating the test with an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Minor tweak suggested.
@neeetman, just noticed you closed this before merging. Any particular reason? |
Sorry, I previously noticed that 'Some checks were not successful,' so I closed it. |
Ah, for future, just ping back about that. Happy to help look into those. That one looks spurious. Seems to have failed in the nightly run a few times as well, so probably needs separate investigation. I'll file an issue on that one and follow up separately. |
This PR addresses the issue where tests would fail if the designated port was already in use.
Changes:
setUp
method inTestResourceStresserBenchmark
class.ServerSocket
to find an available port.The system will attempt up toMAX_TRIES
to find an open port before throwing an exception.