From 5a065a87859074ce449648aa717aeae41c372ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Mon, 19 May 2014 17:42:08 -0700 Subject: [PATCH] fix BatchServerInventoryViewTest waitForSync() logic --- .../io/druid/client/client/BatchServerInventoryViewTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java b/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java index 934d9d959ff..f3bd64a40f6 100644 --- a/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java +++ b/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java @@ -55,7 +55,6 @@ import java.util.concurrent.TimeUnit; public class BatchServerInventoryViewTest { private static final String testBasePath = "/test"; - private static final Joiner joiner = Joiner.on("/"); private TestingCluster testingCluster; private CuratorFramework cf; @@ -199,8 +198,8 @@ public class BatchServerInventoryViewTest private void waitForSync() throws Exception { Stopwatch stopwatch = new Stopwatch().start(); - while (!Iterables.isEmpty(batchServerInventoryView.getInventory()) - && Iterables.get(batchServerInventoryView.getInventory(), 0).getSegments().size() != testSegments.size()) { + while (Iterables.isEmpty(batchServerInventoryView.getInventory()) + || Iterables.get(batchServerInventoryView.getInventory(), 0).getSegments().size() != testSegments.size()) { Thread.sleep(500); if (stopwatch.elapsed(TimeUnit.MILLISECONDS) > 5000) { throw new ISE("BatchServerInventoryView is not updating");