-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Expected behavior
There should be no exception
Actual behavior
When running the PulsarStandalone for unit test with maven + testNG on a windows machine the following exception appears.
2020-05-08 13:13:11,975 [main] WARN .b.c.ConfigurationCacheService Failed to create failure-domain znode /admin/clusters/standalone/failureDomain java.lang.IllegalArgumentException: Path must start with / character at org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:51) at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1090) at org.apache.bookkeeper.zookeeper.ZooKeeperClient.access$2301(ZooKeeperClient.java:70) at org.apache.bookkeeper.zookeeper.ZooKeeperClient$13.call(ZooKeeperClient.java:830) at org.apache.bookkeeper.zookeeper.ZooKeeperClient$13.call(ZooKeeperClient.java:824) at org.apache.bookkeeper.zookeeper.ZooWorker.syncCallWithRetries(ZooWorker.java:140) at org.apache.bookkeeper.zookeeper.ZooKeeperClient.exists(ZooKeeperClient.java:824) at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1139) at org.apache.bookkeeper.zookeeper.ZooKeeperClient.access$2401(ZooKeeperClient.java:70) at org.apache.bookkeeper.zookeeper.ZooKeeperClient$14.call(ZooKeeperClient.java:851) at org.apache.bookkeeper.zookeeper.ZooKeeperClient$14.call(ZooKeeperClient.java:845) at org.apache.bookkeeper.zookeeper.ZooWorker.syncCallWithRetries(ZooWorker.java:140) at org.apache.bookkeeper.zookeeper.ZooKeeperClient.exists(ZooKeeperClient.java:845) at org.apache.pulsar.broker.cache.ConfigurationCacheService.createFailureDomainRoot(ConfigurationCacheService.java:131) at org.apache.pulsar.broker.cache.ConfigurationCacheService.<init>(ConfigurationCacheService.java:106) at org.apache.pulsar.broker.PulsarService.startZkCacheService(PulsarService.java:623) at org.apache.pulsar.broker.PulsarService.start(PulsarService.java:391) at org.apache.pulsar.PulsarStandalone.start(PulsarStandalone.java:318) at com.lsespace.orion.infra.comms.pulsar.End2EndPulsarTest.setup(End2EndPulsarTest.java:41) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:134) at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:63) at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:348) at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:302) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:176) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:122) at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) at org.testng.TestRunner.privateRun(TestRunner.java:766) at org.testng.TestRunner.run(TestRunner.java:587) at org.testng.SuiteRunner.runTest(SuiteRunner.java:384) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337) at org.testng.SuiteRunner.run(SuiteRunner.java:286) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1187) at org.testng.TestNG.runSuitesLocally(TestNG.java:1109) at org.testng.TestNG.runSuites(TestNG.java:1039) at org.testng.TestNG.run(TestNG.java:1007) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
The issue is at line 130 at org.apache.pulsar.broker.cache.ConfigurationCacheService.createFailureDomainRoot
Paths.get(path).getParent().toString(); returns "\admin\clusters\standalone" instead of the expected "/admin/clusters/standalone" This is probably related to windows and linux using different path separators.
Steps to reproduce
Start the PulsarStandAlone in a unit test in windows
System configuration
Tested in Pulsar versions: 2.5.1, 2.5.0 and 2.4.1