From 78142d74f3ed1a23a374f5bd5fdbd7f245a16721 Mon Sep 17 00:00:00 2001 From: EdColeman Date: Tue, 18 Oct 2022 16:31:27 -0400 Subject: [PATCH] fix ZooBasedConfigIT for config node changes (#3030) --- .../test/conf/store/ZooBasedConfigIT.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/test/src/main/java/org/apache/accumulo/test/conf/store/ZooBasedConfigIT.java b/test/src/main/java/org/apache/accumulo/test/conf/store/ZooBasedConfigIT.java index f68d9f25fb4..0862fbc3e30 100644 --- a/test/src/main/java/org/apache/accumulo/test/conf/store/ZooBasedConfigIT.java +++ b/test/src/main/java/org/apache/accumulo/test/conf/store/ZooBasedConfigIT.java @@ -116,30 +116,22 @@ public static void shutdownZK() throws Exception { @BeforeEach public void initPaths() { context = createMock(ServerContext.class); - testZk.initPaths(ZooUtil.getRoot(INSTANCE_ID) + Constants.ZCONFIG); + testZk.initPaths(ZooUtil.getRoot(INSTANCE_ID)); try { zooKeeper.create(ZooUtil.getRoot(INSTANCE_ID) + Constants.ZTABLES, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); + zooKeeper.create(ZooUtil.getRoot(INSTANCE_ID) + Constants.ZTABLES + "/" + tidA.canonical(), new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); - zooKeeper.create( - ZooUtil.getRoot(INSTANCE_ID) + Constants.ZTABLES + "/" + tidA.canonical() + "/conf", - new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); - zooKeeper.create(ZooUtil.getRoot(INSTANCE_ID) + Constants.ZTABLES + "/" + tidB.canonical(), new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); - zooKeeper.create( - ZooUtil.getRoot(INSTANCE_ID) + Constants.ZTABLES + "/" + tidB.canonical() + "/conf", - new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); + zooKeeper.create(ZooUtil.getRoot(INSTANCE_ID) + Constants.ZNAMESPACES, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zooKeeper.create( ZooUtil.getRoot(INSTANCE_ID) + Constants.ZNAMESPACES + "/" + nsId.canonical(), new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); - zooKeeper.create( - ZooUtil.getRoot(INSTANCE_ID) + Constants.ZNAMESPACES + "/" + nsId.canonical() + "/conf", - new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } catch (KeeperException ex) { log.trace("Issue during zk initialization, skipping", ex); @@ -191,8 +183,11 @@ public void cleanupZnodes() { * node should be created. */ @Test - public void upgradeSysTestNoProps() { + public void upgradeSysTestNoProps() throws Exception { replay(context); + // force create empty sys config node. + zooKeeper.create(ZooUtil.getRoot(INSTANCE_ID) + Constants.ZCONFIG, new byte[0], + ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); var propKey = SystemPropKey.of(INSTANCE_ID); ZooBasedConfiguration zbc = new SystemConfiguration(context, propKey, parent); assertNotNull(zbc);