-
Notifications
You must be signed in to change notification settings - Fork 110
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
[LOGMGR-314] SocketHandlerTests produce BindException: Address already in use #374
Conversation
We might be best to just pass |
5b2cba0
to
7b7e196
Compare
Hi @jamezp Thank you for your advice to use the |
Hi @jamezp could you please take a look? |
Assert.assertEquals("Test TCP handler", msg); | ||
} | ||
// wait until the OS really release used port. https://issues.redhat.com/browse/LOGMGR-314 | ||
Thread.sleep(50); |
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.
Is this needed? It feels like a guess at best TBH and feels fragile.
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.
I think too this should not be here. But I didn't find way how to safely verify a port is free. All ways which i found are similar to:
try (Socket ignored = new Socket("localhost", port)) {
return false;
} catch (ConnectException e) {
return true;
}
And we don't have guarantees after end of try with resources or after close method is a port really free. Sometimes isn't - especially when the CPU is utilized to 100% and these tests are started.
Upstream #377 |
https://issues.redhat.com/browse/LOGMGR-314