From 232cf38bdf9d1c9d5273b3e5a4d9d3d8ad55951a Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Wed, 12 Feb 2014 16:01:41 +0000 Subject: [PATCH] tests: add a short poll git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1567663 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/cloud/hdfs/StressHdfsTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java b/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java index 6ac7e886c6b..9004b9113f5 100644 --- a/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/hdfs/StressHdfsTest.java @@ -198,6 +198,16 @@ public class StressHdfsTest extends BasicDistributedZkTest { request.setPath("/admin/collections"); cloudClient.request(request); + long timeout = System.currentTimeMillis() + 10000; + while (cloudClient.getZkStateReader().getClusterState().hasCollection(DELETE_DATA_DIR_COLLECTION)) { + if (System.currentTimeMillis() > timeout) { + throw new AssertionError("Timeout waiting to see removed collection leave clusterstate"); + } + + Thread.sleep(200); + cloudClient.getZkStateReader().updateClusterState(true); + } + // check that all dirs are gone for (String dataDir : dataDirs) { Configuration conf = new Configuration();