This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 9864e005d2 ARTEMIS-4174: test is verifying hostname detail, so use 
floating ports to avoid sporadic bind failures that are happening
9864e005d2 is described below

commit 9864e005d2db63531827588f1cd55082f9d7c505
Author: Robbie Gemmell <[email protected]>
AuthorDate: Wed Sep 6 16:31:42 2023 +0100

    ARTEMIS-4174: test is verifying hostname detail, so use floating ports to 
avoid sporadic bind failures that are happening
---
 .../activemq/artemis/core/server/management/RmiRegistryFactory.java   | 2 +-
 .../artemis/core/server/management/JMXRMIRegistryPortTest.java        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/RmiRegistryFactory.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/RmiRegistryFactory.java
index ed505a7d22..2589204f77 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/RmiRegistryFactory.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/RmiRegistryFactory.java
@@ -63,7 +63,7 @@ public class RmiRegistryFactory {
     * Create a server socket for testing purposes.
     */
    ServerSocket createTestSocket() throws IOException {
-      return socketFactory.createServerSocket(1100);
+      return socketFactory.createServerSocket(0);
    }
 
    public Object getObject() throws Exception {
diff --git 
a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/management/JMXRMIRegistryPortTest.java
 
b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/management/JMXRMIRegistryPortTest.java
index c5e7f6002a..ac2741728e 100644
--- 
a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/management/JMXRMIRegistryPortTest.java
+++ 
b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/management/JMXRMIRegistryPortTest.java
@@ -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()) {
@@ -43,7 +43,7 @@ public class JMXRMIRegistryPortTest extends ActiveMQTestBase {
    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()) {

Reply via email to