This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 2e74a4cefc Fixed UpgradeIT (#5768)
2e74a4cefc is described below
commit 2e74a4cefc1e369989e8666e9ef78558749e5961
Author: Dave Marion <[email protected]>
AuthorDate: Thu Jul 31 10:22:11 2025 -0400
Fixed UpgradeIT (#5768)
Modified UpgradeIT such that test server implementations
have their own ServerContext instead of sharing the one
that Mini uses. Also changed test to check for server locks
using a different method.
Closes #5767
---
.../apache/accumulo/test/upgrade/UpgradeIT.java | 47 +++++++++++++++-------
1 file changed, 33 insertions(+), 14 deletions(-)
diff --git a/test/src/main/java/org/apache/accumulo/test/upgrade/UpgradeIT.java
b/test/src/main/java/org/apache/accumulo/test/upgrade/UpgradeIT.java
index 165ff174dc..e0c72ca2c2 100644
--- a/test/src/main/java/org/apache/accumulo/test/upgrade/UpgradeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/upgrade/UpgradeIT.java
@@ -31,10 +31,10 @@ import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.cli.ConfigOpts;
import org.apache.accumulo.core.client.admin.servers.ServerId;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.fate.zookeeper.ZooReader;
import org.apache.accumulo.core.fate.zookeeper.ZooReaderWriter;
import org.apache.accumulo.core.fate.zookeeper.ZooUtil.NodeExistsPolicy;
import org.apache.accumulo.core.lock.ServiceLock;
+import org.apache.accumulo.core.lock.ServiceLockPaths.AddressSelector;
import org.apache.accumulo.core.zookeeper.ZooSession;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.manager.Manager;
@@ -51,7 +51,7 @@ public class UpgradeIT extends AccumuloClusterHarness {
private class ServerThatWontStart extends AbstractServer {
protected ServerThatWontStart(String[] args) {
- super(ServerId.Type.TABLET_SERVER, new ConfigOpts(), (conf) ->
getServerContext(), args);
+ super(ServerId.Type.TABLET_SERVER, new ConfigOpts(), (conf) -> new
ServerContext(conf), args);
}
@Override
@@ -62,15 +62,27 @@ public class UpgradeIT extends AccumuloClusterHarness {
return null;
}
+ @Override
+ public void startServiceLockVerificationThread() {}
+
+ @Override
+ public void close() {}
+
}
// This class exists because Manager constructor is not visible
private class TestManager extends Manager {
protected TestManager(String[] args) throws IOException {
- super(new ConfigOpts(), (conf) -> getServerContext(), args);
+ super(new ConfigOpts(), (conf) -> new ServerContext(conf), args);
}
+ @Override
+ public void startServiceLockVerificationThread() {}
+
+ @Override
+ public void close() {}
+
}
@Override
@@ -101,21 +113,28 @@ public class UpgradeIT extends AccumuloClusterHarness {
getCluster().getClusterControl().startAllServers(ServerType.ZOOKEEPER);
- final ZooReader zr = zs.asReader();
- Wait.waitFor(() -> zr.getChildren(Constants.ZCOMPACTORS).isEmpty());
- Wait.waitFor(() -> zr.getChildren(Constants.ZGC_LOCK).isEmpty());
- Wait.waitFor(() -> zr.getChildren(Constants.ZMANAGER_LOCK).isEmpty());
- Wait.waitFor(() -> zr.getChildren(Constants.ZSSERVERS).isEmpty());
- Wait.waitFor(() -> zr.getChildren(Constants.ZTSERVERS).isEmpty());
+ // Confirm all servers down
+ Wait.waitFor(() -> getServerContext().getServerPaths()
+ .getCompactor((rg) -> true, AddressSelector.all(), true).size() == 0);
+ Wait.waitFor(() ->
getServerContext().getServerPaths().getGarbageCollector(true) == null);
+ Wait.waitFor(() -> getServerContext().getServerPaths().getManager(true) ==
null);
+ Wait.waitFor(() -> getServerContext().getServerPaths()
+ .getScanServer((rg) -> true, AddressSelector.all(), true).size() == 0);
+ Wait.waitFor(() -> getServerContext().getServerPaths()
+ .getTabletServer((rg) -> true, AddressSelector.all(), true).size() ==
0);
assertThrows(IllegalStateException.class,
() -> assertTimeoutPreemptively(Duration.ofMinutes(2), () ->
getCluster().start()));
- assertTrue(zr.getChildren(Constants.ZCOMPACTORS).isEmpty());
- assertTrue(zr.getChildren(Constants.ZGC_LOCK).isEmpty());
- assertTrue(zr.getChildren(Constants.ZMANAGER_LOCK).isEmpty());
- assertTrue(zr.getChildren(Constants.ZSSERVERS).isEmpty());
- assertTrue(zr.getChildren(Constants.ZTSERVERS).isEmpty());
+ // Confirm no servers started
+ Wait.waitFor(() -> getServerContext().getServerPaths()
+ .getCompactor((rg) -> true, AddressSelector.all(), true).size() == 0);
+ Wait.waitFor(() ->
getServerContext().getServerPaths().getGarbageCollector(true) == null);
+ Wait.waitFor(() -> getServerContext().getServerPaths().getManager(true) ==
null);
+ Wait.waitFor(() -> getServerContext().getServerPaths()
+ .getScanServer((rg) -> true, AddressSelector.all(), true).size() == 0);
+ Wait.waitFor(() -> getServerContext().getServerPaths()
+ .getTabletServer((rg) -> true, AddressSelector.all(), true).size() ==
0);
// Validate the exception from the servers
List<String> args = new ArrayList<>();