Skip to content

Commit 7686ee7

Browse files
TESTS: Shutdown ThreadPool after TestNodes (#37123)
* If the threadpool gets shut down before the testnodes we run into an error => fixed by moving to single `After` method * Relates #36976
1 parent 2c3ce5b commit 7686ee7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,6 @@ public void setupThreadPool() {
8181
threadPool = new TestThreadPool(TransportTasksActionTests.class.getSimpleName());
8282
}
8383

84-
@After
85-
public void tearDownThreadPool() {
86-
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
87-
threadPool = null;
88-
}
89-
9084
public void setupTestNodes(Settings settings) {
9185
nodesCount = randomIntBetween(2, 10);
9286
testNodes = new TestNode[nodesCount];
@@ -100,6 +94,8 @@ public final void shutdownTestNodes() throws Exception {
10094
for (TestNode testNode : testNodes) {
10195
testNode.close();
10296
}
97+
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
98+
threadPool = null;
10399
}
104100

105101

0 commit comments

Comments
 (0)