fix BatchServerInventoryViewTest waitForSync() logic

This commit is contained in:
Xavier Léauté 2014-05-19 17:42:08 -07:00
parent 1b6e816c28
commit 5a065a8785
1 changed files with 2 additions and 3 deletions

View File

@ -55,7 +55,6 @@ import java.util.concurrent.TimeUnit;
public class BatchServerInventoryViewTest public class BatchServerInventoryViewTest
{ {
private static final String testBasePath = "/test"; private static final String testBasePath = "/test";
private static final Joiner joiner = Joiner.on("/");
private TestingCluster testingCluster; private TestingCluster testingCluster;
private CuratorFramework cf; private CuratorFramework cf;
@ -199,8 +198,8 @@ public class BatchServerInventoryViewTest
private void waitForSync() throws Exception private void waitForSync() throws Exception
{ {
Stopwatch stopwatch = new Stopwatch().start(); Stopwatch stopwatch = new Stopwatch().start();
while (!Iterables.isEmpty(batchServerInventoryView.getInventory()) while (Iterables.isEmpty(batchServerInventoryView.getInventory())
&& Iterables.get(batchServerInventoryView.getInventory(), 0).getSegments().size() != testSegments.size()) { || Iterables.get(batchServerInventoryView.getInventory(), 0).getSegments().size() != testSegments.size()) {
Thread.sleep(500); Thread.sleep(500);
if (stopwatch.elapsed(TimeUnit.MILLISECONDS) > 5000) { if (stopwatch.elapsed(TimeUnit.MILLISECONDS) > 5000) {
throw new ISE("BatchServerInventoryView is not updating"); throw new ISE("BatchServerInventoryView is not updating");