fix non deterministic behaviour in test

This commit is contained in:
fjy 2013-12-02 17:02:24 -08:00
parent 1a3a1221c2
commit 929b2336a9
2 changed files with 3 additions and 2 deletions

View File

@ -202,7 +202,7 @@ The schema of the Hadoop Index Task contains a task "type" and a Hadoop Index Co
"type" : "static",
"paths" : "data.json"
},
"targetPartitionSize" : 5000000,
"targetPartitionSi:qze" : 5000000,
"rollupSpec" : {
"aggs": [{
"type" : "count",

View File

@ -198,7 +198,8 @@ public class BatchServerInventoryViewTest
private void waitForSync() throws Exception
{
Stopwatch stopwatch = new Stopwatch().start();
while (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");