For my tests I am using a test Zookeeper server but I would like to be able to wait until the server is fully started (since I am starting it as part of the test init process).
How is it possible to cleanly check that a (Test) Zookeeper server is correctly started using Curator? Some form of ping/etc?
I managed to find the answer and wanted to share.
Curator has a method blockUntilConnected which will wait until it gets a connection from Zookeeper.
CuratorFramework curator = CuratorFrameworkFactory.newClient("localhost:" + TestConstants.TEST_ZOOKEEPER_PORT, new RetryOneTime(100));
curator.start();
curator.blockUntilConnected();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments