test: do not schedule when test has stopped

This commit is contained in:
Martijn van Groningen 2018-09-06 14:14:24 +02:00
parent cdd82bb203
commit ef207edbf0
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
1 changed files with 3 additions and 1 deletions

View File

@ -81,7 +81,9 @@ public class ShardFollowNodeTaskRandomTests extends ESTestCase {
ThreadPool threadPool = new TestThreadPool(getClass().getSimpleName());
BiConsumer<TimeValue, Runnable> scheduler = (delay, task) -> {
assert delay.millis() < 100 : "The delay should be kept to a minimum, so that this test does not take to long to run";
threadPool.schedule(delay, ThreadPool.Names.GENERIC, task);
if (stopped.get() == false) {
threadPool.schedule(delay, ThreadPool.Names.GENERIC, task);
}
};
List<Translog.Operation> receivedOperations = Collections.synchronizedList(new ArrayList<>());
LocalCheckpointTracker tracker = new LocalCheckpointTracker(testRun.startSeqNo - 1, testRun.startSeqNo - 1);