Skip to content

Commit ef207ed

Browse files
committed
test: do not schedule when test has stopped
1 parent cdd82bb commit ef207ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskRandomTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ private ShardFollowNodeTask createShardFollowTask(int concurrency, TestRun testR
8181
ThreadPool threadPool = new TestThreadPool(getClass().getSimpleName());
8282
BiConsumer<TimeValue, Runnable> scheduler = (delay, task) -> {
8383
assert delay.millis() < 100 : "The delay should be kept to a minimum, so that this test does not take to long to run";
84-
threadPool.schedule(delay, ThreadPool.Names.GENERIC, task);
84+
if (stopped.get() == false) {
85+
threadPool.schedule(delay, ThreadPool.Names.GENERIC, task);
86+
}
8587
};
8688
List<Translog.Operation> receivedOperations = Collections.synchronizedList(new ArrayList<>());
8789
LocalCheckpointTracker tracker = new LocalCheckpointTracker(testRun.startSeqNo - 1, testRun.startSeqNo - 1);

0 commit comments

Comments
 (0)