Skip to content

Commit

Permalink
ARTEMIS-4174: test is verifying hostname detail, so use floating port…
Browse files Browse the repository at this point in the history
…s to avoid sporadic bind failures that are happening
  • Loading branch information
gemmellr committed Sep 6, 2023
1 parent aa4e440 commit 9864e00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void setHost(String host) {
* Create a server socket for testing purposes.
*/
ServerSocket createTestSocket() throws IOException {
return socketFactory.createServerSocket(1100);
return socketFactory.createServerSocket(0);
}

public Object getObject() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class JMXRMIRegistryPortTest extends ActiveMQTestBase {
public void explicitLocalhostRegistry() throws IOException {
RmiRegistryFactory registryFactory = new RmiRegistryFactory();
registryFactory.setHost("localhost");
registryFactory.setPort(1099);
registryFactory.setPort(0);
registryFactory.init();
runAfter(registryFactory::destroy);
try (ServerSocket testSocket = registryFactory.createTestSocket()) {
Expand All @@ -43,7 +43,7 @@ public void explicitLocalhostRegistry() throws IOException {
public void unlimitedHostRegistry() throws IOException {
RmiRegistryFactory registryFactory = new RmiRegistryFactory();
registryFactory.setHost(null);
registryFactory.setPort(1099);
registryFactory.setPort(0);
registryFactory.init();
runAfter(registryFactory::destroy);
try (ServerSocket testSocket = registryFactory.createTestSocket()) {
Expand Down

0 comments on commit 9864e00

Please sign in to comment.