Make testAllOperationsInvoked properly clean up after itself

This commit is contained in:
Yannick Welsch 2016-07-02 11:54:52 +02:00
parent 3221c9d970
commit 3e199b1dff
1 changed files with 4 additions and 0 deletions

View File

@ -92,10 +92,12 @@ public class IndexShardOperationsLockTests extends ESTestCase {
operationThreads.add(thread);
}
CountDownLatch blockFinished = new CountDownLatch(1);
threadPool.generic().execute(() -> {
try {
latch.await();
blockAndWait().close();
blockFinished.countDown();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
@ -112,6 +114,8 @@ public class IndexShardOperationsLockTests extends ESTestCase {
for (Thread thread : operationThreads) {
thread.join();
}
blockFinished.await();
}