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
This commit is contained in:
parent
2c3ce5b9de
commit
7686ee7631
|
@ -81,12 +81,6 @@ public abstract class TaskManagerTestCase extends ESTestCase {
|
||||||
threadPool = new TestThreadPool(TransportTasksActionTests.class.getSimpleName());
|
threadPool = new TestThreadPool(TransportTasksActionTests.class.getSimpleName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
|
||||||
public void tearDownThreadPool() {
|
|
||||||
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
||||||
threadPool = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setupTestNodes(Settings settings) {
|
public void setupTestNodes(Settings settings) {
|
||||||
nodesCount = randomIntBetween(2, 10);
|
nodesCount = randomIntBetween(2, 10);
|
||||||
testNodes = new TestNode[nodesCount];
|
testNodes = new TestNode[nodesCount];
|
||||||
|
@ -100,6 +94,8 @@ public abstract class TaskManagerTestCase extends ESTestCase {
|
||||||
for (TestNode testNode : testNodes) {
|
for (TestNode testNode : testNodes) {
|
||||||
testNode.close();
|
testNode.close();
|
||||||
}
|
}
|
||||||
|
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
||||||
|
threadPool = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue