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:
Armin Braun 2019-01-03 22:35:44 +01:00 committed by GitHub
parent 2c3ce5b9de
commit 7686ee7631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -81,12 +81,6 @@ public abstract class TaskManagerTestCase extends ESTestCase {
threadPool = new TestThreadPool(TransportTasksActionTests.class.getSimpleName());
}
@After
public void tearDownThreadPool() {
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
threadPool = null;
}
public void setupTestNodes(Settings settings) {
nodesCount = randomIntBetween(2, 10);
testNodes = new TestNode[nodesCount];
@ -100,6 +94,8 @@ public abstract class TaskManagerTestCase extends ESTestCase {
for (TestNode testNode : testNodes) {
testNode.close();
}
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
threadPool = null;
}