fix test to shutdown threadpool
This commit is contained in:
parent
7b3b130a62
commit
1a98a9184e
|
@ -45,6 +45,7 @@ import org.elasticsearch.index.translog.Translog;
|
||||||
import org.elasticsearch.index.translog.fs.FsTranslog;
|
import org.elasticsearch.index.translog.fs.FsTranslog;
|
||||||
import org.elasticsearch.test.unit.index.deletionpolicy.SnapshotIndexCommitExistsMatcher;
|
import org.elasticsearch.test.unit.index.deletionpolicy.SnapshotIndexCommitExistsMatcher;
|
||||||
import org.elasticsearch.test.unit.index.translog.TranslogSizeMatcher;
|
import org.elasticsearch.test.unit.index.translog.TranslogSizeMatcher;
|
||||||
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.hamcrest.MatcherAssert;
|
import org.hamcrest.MatcherAssert;
|
||||||
import org.testng.annotations.AfterMethod;
|
import org.testng.annotations.AfterMethod;
|
||||||
import org.testng.annotations.BeforeMethod;
|
import org.testng.annotations.BeforeMethod;
|
||||||
|
@ -71,6 +72,8 @@ public abstract class AbstractSimpleEngineTests {
|
||||||
|
|
||||||
protected final ShardId shardId = new ShardId(new Index("index"), 1);
|
protected final ShardId shardId = new ShardId(new Index("index"), 1);
|
||||||
|
|
||||||
|
protected ThreadPool threadPool;
|
||||||
|
|
||||||
private Store store;
|
private Store store;
|
||||||
private Store storeReplica;
|
private Store storeReplica;
|
||||||
|
|
||||||
|
@ -79,6 +82,7 @@ public abstract class AbstractSimpleEngineTests {
|
||||||
|
|
||||||
@BeforeMethod
|
@BeforeMethod
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
threadPool = new ThreadPool();
|
||||||
store = createStore();
|
store = createStore();
|
||||||
store.deleteContent();
|
store.deleteContent();
|
||||||
storeReplica = createStoreReplica();
|
storeReplica = createStoreReplica();
|
||||||
|
@ -96,6 +100,10 @@ public abstract class AbstractSimpleEngineTests {
|
||||||
|
|
||||||
engine.close();
|
engine.close();
|
||||||
store.close();
|
store.close();
|
||||||
|
|
||||||
|
if (threadPool != null) {
|
||||||
|
threadPool.shutdownNow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Store createStore() throws IOException {
|
protected Store createStore() throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue