You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This does not work (at least on OS X) if something is already bound to localhost but not to other network interfaces. Instead, the requested socket is successfully bound to other network interfaces.
Proposal
Since tests generally want to bind to localhost, SocketUtils should test the loopback interface to ensure that the port is actually available for localhost.
Properly detect available port on localhost in SocketUtils
SocketUtils is used to find available ports on localhost; however, prior to this commit, SocketUtils incorrectly reported a port as available on localhost if another process was already bound to localhost on the given port but not to other network interfaces. In other words, SocketUtils determined that a given port was available for some interface though not necessarily for the loopback interface.
This commit addresses this issue by refactoring SocketUtils so that it tests the loopback interface to ensure that the port is actually available for localhost.
Gary Russell opened SPR-13321 and commented
Status Quo
SocketUtils
attempts to find an unused socket.This does not work (at least on OS X) if something is already bound to
localhost
but not to other network interfaces. Instead, the requested socket is successfully bound to other network interfaces.Proposal
Since tests generally want to bind to
localhost
,SocketUtils
should test theloopback
interface to ensure that the port is actually available forlocalhost
.Further Resources
See pull request 1537 for a similar fix in Spring Integration.
Affects: 4.0 GA
Referenced from: pull request #853, and commits f151404
The text was updated successfully, but these errors were encountered: