From 31502a920cc29adad6ec2281802b887fdf644686 Mon Sep 17 00:00:00 2001 From: Bingkun Guo Date: Wed, 9 Dec 2015 13:59:33 -0600 Subject: [PATCH] Add comment to BrokerServerViewTest Explain why we need to do explicit checks on existences of zNodes before we create them. Address issue: https://github.com/druid-io/druid/issues/1512 --- .../src/test/java/io/druid/client/BrokerServerViewTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/test/java/io/druid/client/BrokerServerViewTest.java b/server/src/test/java/io/druid/client/BrokerServerViewTest.java index 84c7f057fa9..3ba41afcc9a 100644 --- a/server/src/test/java/io/druid/client/BrokerServerViewTest.java +++ b/server/src/test/java/io/druid/client/BrokerServerViewTest.java @@ -374,6 +374,11 @@ public class BrokerServerViewTest extends CuratorTestBase final String zNodePathAnnounce = ZKPaths.makePath(announcementsPath, server.getHost()); final String zNodePathSegment = ZKPaths.makePath(inventoryPath, server.getHost()); + /* + * Explicitly check whether the zNodes we are about to create exist or not, + * if exist, delete them to make sure we have a clean state on zookeeper. + * Address issue: https://github.com/druid-io/druid/issues/1512 + */ if (curator.checkExists().forPath(zNodePathAnnounce) != null) { curator.delete().guaranteed().forPath(zNodePathAnnounce); }