From ef207edbf0ce3edb408b37de733aedc816d778c1 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 6 Sep 2018 14:14:24 +0200 Subject: [PATCH] test: do not schedule when test has stopped --- .../xpack/ccr/action/ShardFollowNodeTaskRandomTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskRandomTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskRandomTests.java index f5fe1215a0e..9bfd6b9d6ef 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskRandomTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskRandomTests.java @@ -81,7 +81,9 @@ public class ShardFollowNodeTaskRandomTests extends ESTestCase { ThreadPool threadPool = new TestThreadPool(getClass().getSimpleName()); BiConsumer 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 receivedOperations = Collections.synchronizedList(new ArrayList<>()); LocalCheckpointTracker tracker = new LocalCheckpointTracker(testRun.startSeqNo - 1, testRun.startSeqNo - 1);