fix test to wait for async indexing to finish

This commit is contained in:
Shay Banon 2011-12-09 10:04:11 +02:00
parent 0412e3e2e6
commit a71f2eed99
1 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,7 @@ import java.util.Random;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import static com.google.common.collect.Sets.newHashSet;
import static org.elasticsearch.client.Requests.*;
@ -516,6 +517,11 @@ public class IndexAliasesTests extends AbstractNodesTests {
});
}
executor.shutdown();
boolean done = executor.awaitTermination(10, TimeUnit.SECONDS);
assertThat(done, equalTo(true));
if (!done) {
executor.shutdownNow();
}
}