Skip to content

Commit

Permalink
Merge pull request wildfly#18045 from bstansberry/WFLY-18780
Browse files Browse the repository at this point in the history
[WFLY-19537] Bind misc external testsuite servers to the server address to avoid test env networking issues
  • Loading branch information
bstansberry authored Jul 13, 2024
2 parents c086269 + f9e95bd commit 03995ce
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void beforeTest() throws Exception {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
final String address = managementClient.getMgmtAddress();
rmiServerJndiName = "rmi://" + address + ":" + port + "/jmxrmi";
jmxServiceURL = new JMXServiceURL("service:jmx:rmi:///jndi/"+rmiServerJndiName);
jmxServiceURL = new JMXServiceURL("service:jmx:rmi://" + address + "/jndi/"+rmiServerJndiName);
connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, null, mbs);
connectorServer.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javax.naming.NamingException;

import org.jboss.as.arquillian.container.NetworkUtils;
import org.jboss.as.test.shared.TestSuiteEnvironment;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.ORBPackage.InvalidName;

Expand All @@ -36,6 +37,7 @@ public class Util {

public static void presetOrb() throws InvalidName, SystemException {
Properties properties = new Properties();
properties.setProperty(ORBConstants.SERVER_HOST_PROPERTY, TestSuiteEnvironment.getServerAddress());
properties.setProperty(ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY, "15151");
properties.setProperty(ORBConstants.ORB_SERVER_ID_PROPERTY, "1");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.jboss.as.controller.operations.common.Util;
import org.jboss.as.test.integration.security.common.Utils;
import org.jboss.as.test.shared.ServerReload;
import org.jboss.as.test.shared.TestSuiteEnvironment;
import org.jboss.as.test.shared.TimeoutUtil;
import org.jboss.dmr.ModelNode;
import org.jboss.logging.Logger;
Expand Down Expand Up @@ -89,7 +90,12 @@ public void setup(final ManagementClient managementClient, final String containe
if (h2Server == null) {
//We need a TCP server that can be shared between the two servers.
//To allow remote connections, start the TCP server using the option -tcpAllowOthers
h2Server = Server.createTcpServer("-tcpAllowOthers", "-ifNotExists").start();
try {
System.setProperty("h2.bindAddress", TestSuiteEnvironment.getServerAddress());
h2Server = Server.createTcpServer("-tcpAllowOthers", "-ifNotExists").start();
} finally {
System.clearProperty("h2.bindAddress");
}
}

if (savedDefaultJobRepository == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.jboss.as.test.integration.security.common.Utils;
import org.jboss.as.test.shared.FileUtils;
import org.jboss.as.test.shared.ServerReload;
import org.jboss.as.test.shared.TestSuiteEnvironment;
import org.jboss.as.test.shared.integration.ejb.security.CallbackHandler;
import org.jboss.dmr.ModelNode;
import org.jboss.shrinkwrap.api.Archive;
Expand Down Expand Up @@ -78,7 +79,12 @@ public void setup(final ManagementClient managementClient, final String containe
if (server == null) {
//we need a TCP server that can be shared between the two servers
//To allow remote connections, start the TCP server using the option -tcpAllowOthers
server = Server.createTcpServer("-tcpAllowOthers", "-ifNotExists").start();
try {
System.setProperty("h2.bindAddress", TestSuiteEnvironment.getServerAddress());
server = Server.createTcpServer("-tcpAllowOthers", "-ifNotExists").start();
} finally {
System.clearProperty("h2.bindAddress");
}
}

final ModelNode compositeOp = new ModelNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.COMPOSITE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVICE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STEPS;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
import static org.jboss.as.test.multinode.ejb.timer.database.DatabaseTimerServiceMultiNodeExecutionDisabledTestCase.getRemoteContext;
Expand Down Expand Up @@ -38,6 +37,7 @@
import org.jboss.as.test.integration.security.common.Utils;
import org.jboss.as.test.shared.FileUtils;
import org.jboss.as.test.shared.ServerReload;
import org.jboss.as.test.shared.TestSuiteEnvironment;
import org.jboss.as.test.shared.TimeoutUtil;
import org.jboss.dmr.ModelNode;
import org.jboss.shrinkwrap.api.Archive;
Expand Down Expand Up @@ -66,9 +66,6 @@ public class DatabaseTimerServiceMultiNodeTestCase {

private static final int TIMER_DELAY = 400;

static final PathAddress ADDR_DATA_SOURCE = PathAddress.pathAddress().append(SUBSYSTEM, "datasources").append("data-source", "MyNewDs");
static final PathAddress ADDR_DATA_STORE = PathAddress.pathAddress().append(SUBSYSTEM, "ejb3").append(SERVICE, "timer-service").append("database-data-store", "dbstore");

@AfterClass
public static void afterClass() {
if(server != null) {
Expand All @@ -88,7 +85,12 @@ public void setup(final ManagementClient managementClient, final String containe
if(server == null) {
//we need a TCP server that can be shared between the two servers
//To allow remote connections, start the TCP server using the option -tcpAllowOthers
server = Server.createTcpServer("-tcpAllowOthers", "-ifNotExists").start();
try {
System.setProperty("h2.bindAddress", TestSuiteEnvironment.getServerAddress());
server = Server.createTcpServer("-tcpAllowOthers", "-ifNotExists").start();
} finally {
System.clearProperty("h2.bindAddress");
}
}

final ModelNode compositeOp = new ModelNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.COMPOSITE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVICE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STEPS;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
import static org.jboss.as.test.multinode.ejb.timer.database.DatabaseTimerServiceMultiNodeExecutionDisabledTestCase.getRemoteContext;
Expand Down Expand Up @@ -40,6 +39,7 @@
import org.jboss.as.controller.operations.common.Util;
import org.jboss.as.test.integration.security.common.Utils;
import org.jboss.as.test.shared.ServerReload;
import org.jboss.as.test.shared.TestSuiteEnvironment;
import org.jboss.dmr.ModelNode;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
Expand All @@ -56,9 +56,6 @@ public class DatabaseTimerServiceRefreshTestCase {
private static Server server;
private static final long TIMER_DELAY = TimeUnit.MINUTES.toMillis(20);

static final PathAddress ADDR_DATA_SOURCE = PathAddress.pathAddress().append(SUBSYSTEM, "datasources").append("data-source", "MyNewDs");
static final PathAddress ADDR_DATA_STORE = PathAddress.pathAddress().append(SUBSYSTEM, "ejb3").append(SERVICE, "timer-service").append("database-data-store", "dbstore");

@AfterClass
public static void afterClass() {
if (server != null) {
Expand All @@ -78,7 +75,12 @@ public void setup(final ManagementClient managementClient, final String containe
if (server == null) {
//we need a TCP server that can be shared between the two servers
//To allow remote connections, start the TCP server using the option -tcpAllowOthers
server = Server.createTcpServer("-tcpAllowOthers", "-ifNotExists").start();
try {
System.setProperty("h2.bindAddress", TestSuiteEnvironment.getServerAddress());
server = Server.createTcpServer("-tcpAllowOthers", "-ifNotExists").start();
} finally {
System.clearProperty("h2.bindAddress");
}
}

final ModelNode compositeOp = new ModelNode();
Expand Down

0 comments on commit 03995ce

Please sign in to comment.