From 090689393446031988f504df4a4bd1e95e3236d3 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Mon, 16 Dec 2024 12:14:39 -0500 Subject: [PATCH] ARTEMIS-5214 Trying to address intermittent failure on CuratorDistributedLockTest To be honest I am not 100% sure this will fix the issue I saw, but it will certainly help me diagnose future failures, by making sure the server is stopped and assigning a proper ID on each server. For future record I am seeing the following exception occasionally on a CI: Caused by: org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Client and election port must be different! Please update the configuration file on server.14 at org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer.initializeWithAddressString(QuorumPeer.java:366) --- .../lockmanager/zookeeper/CuratorDistributedLockTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artemis-lockmanager/artemis-lockmanager-ri/src/test/java/org/apache/activemq/artemis/lockmanager/zookeeper/CuratorDistributedLockTest.java b/artemis-lockmanager/artemis-lockmanager-ri/src/test/java/org/apache/activemq/artemis/lockmanager/zookeeper/CuratorDistributedLockTest.java index 1d219bf5f2b..f5bcfad1566 100644 --- a/artemis-lockmanager/artemis-lockmanager-ri/src/test/java/org/apache/activemq/artemis/lockmanager/zookeeper/CuratorDistributedLockTest.java +++ b/artemis-lockmanager/artemis-lockmanager-ri/src/test/java/org/apache/activemq/artemis/lockmanager/zookeeper/CuratorDistributedLockTest.java @@ -78,7 +78,7 @@ public void setupEnv() throws Throwable { clusterSpecs = new InstanceSpec[zkNodes]; for (int i = 0; i < zkNodes; i++) { - clusterSpecs[i] = new InstanceSpec(newFolder(tmpFolder, "node" + i), BASE_SERVER_PORT + i, -1, -1, true, -1, SERVER_TICK_MS, -1); + clusterSpecs[i] = new InstanceSpec(newFolder(tmpFolder, "node" + i), BASE_SERVER_PORT + i, -1, -1, true, i, SERVER_TICK_MS, -1); } testingServer = new TestingCluster(clusterSpecs); testingServer.start(); @@ -90,6 +90,7 @@ public void setupEnv() throws Throwable { @Override public void tearDownEnv() throws Throwable { super.tearDownEnv(); + testingServer.stop(); testingServer.close(); }