Testing: Properly terminate thread pools
Original commit: elastic/x-pack-elasticsearch@a16cbed365
This commit is contained in:
parent
a4a88c1a82
commit
3f9f0fcadb
|
@ -69,5 +69,11 @@ public class VersionCompatibilityTests extends ElasticsearchTestCase {
|
||||||
* since es core 1.5.0 introduced the AliasesRequest interface.
|
* since es core 1.5.0 introduced the AliasesRequest interface.
|
||||||
*/
|
*/
|
||||||
assertThat("Remove special treatment for IndicesAliasesRequest and GetAliasesRequest", Version.CURRENT.onOrBefore(Version.V_1_4_2), is(true));
|
assertThat("Remove special treatment for IndicesAliasesRequest and GetAliasesRequest", Version.CURRENT.onOrBefore(Version.V_1_4_2), is(true));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* see https://github.com/elasticsearch/elasticsearch/pull/9508
|
||||||
|
* CheckFileCommand has been moved into ES-Core, please check the supported versions in the PR, if it can be removed completely
|
||||||
|
*/
|
||||||
|
assertThat("Remove built-in CheckFileCommand", Version.CURRENT.onOrBefore(Version.V_1_4_2), is(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,8 +60,8 @@ public class FileUserPasswdStoreTests extends ElasticsearchTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void shutdown() {
|
public void shutdown() throws InterruptedException {
|
||||||
threadPool.shutdownNow();
|
terminate(threadPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -59,8 +59,8 @@ public class FileUserRolesStoreTests extends ElasticsearchTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void shutdown() {
|
public void shutdown() throws InterruptedException {
|
||||||
threadPool.shutdownNow();
|
terminate(threadPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -239,9 +239,7 @@ public class FileUserRolesStoreTests extends ElasticsearchTestCase {
|
||||||
FileUserRolesStore store = new FileUserRolesStore(config, watcherService);
|
FileUserRolesStore store = new FileUserRolesStore(config, watcherService);
|
||||||
assertThat(store.roles("user"), equalTo(Strings.EMPTY_ARRAY));
|
assertThat(store.roles("user"), equalTo(Strings.EMPTY_ARRAY));
|
||||||
} finally {
|
} finally {
|
||||||
if (threadPool != null) {
|
terminate(threadPool);
|
||||||
threadPool.shutdownNow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@ public class LdapRealmTest extends LdapTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void shutdown() {
|
public void shutdown() throws InterruptedException {
|
||||||
resourceWatcherService.stop();
|
resourceWatcherService.stop();
|
||||||
threadPool.shutdownNow();
|
terminate(threadPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -51,8 +51,8 @@ public abstract class AbstractGroupToRoleMapperTests extends ElasticsearchTestCa
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void shutdown() {
|
public void shutdown() throws InterruptedException {
|
||||||
threadPool.shutdownNow();
|
terminate(threadPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract AbstractGroupToRoleMapper createMapper(Path file, ResourceWatcherService watcherService);
|
protected abstract AbstractGroupToRoleMapper createMapper(Path file, ResourceWatcherService watcherService);
|
||||||
|
|
|
@ -174,9 +174,7 @@ public class FileRolesStoreTests extends ElasticsearchTestCase {
|
||||||
if (watcherService != null) {
|
if (watcherService != null) {
|
||||||
watcherService.stop();
|
watcherService.stop();
|
||||||
}
|
}
|
||||||
if (threadPool != null) {
|
terminate(threadPool);
|
||||||
threadPool.shutdownNow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ public class InternalSignatureServiceTests extends ElasticsearchTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void shutdown() {
|
public void shutdown() throws InterruptedException {
|
||||||
threadPool.shutdownNow();
|
terminate(threadPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue