From efac9192ed3bcdcdfd7a0e0496dbc142d032c0e7 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 16 Aug 2024 16:28:08 -0400 Subject: [PATCH] Terminate TestThreadPool Signed-off-by: Craig Perkins --- .../org/opensearch/identity/shiro/ShiroIdentityPluginTests.java | 2 ++ .../test/java/org/opensearch/bootstrap/IdentityPluginTests.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroIdentityPluginTests.java b/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroIdentityPluginTests.java index cb09590918278..bc14410d81de0 100644 --- a/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroIdentityPluginTests.java +++ b/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroIdentityPluginTests.java @@ -30,6 +30,7 @@ public void testSingleIdentityPluginSucceeds() { List pluginList1 = List.of(identityPlugin1); IdentityService identityService1 = new IdentityService(Settings.EMPTY, threadPool, pluginList1); assertThat(identityService1.getTokenManager(), is(instanceOf(ShiroTokenManager.class))); + terminate(threadPool); } public void testMultipleIdentityPluginsFail() { @@ -40,6 +41,7 @@ public void testMultipleIdentityPluginsFail() { List pluginList = List.of(identityPlugin1, identityPlugin2, identityPlugin3); Exception ex = assertThrows(OpenSearchException.class, () -> new IdentityService(Settings.EMPTY, threadPool, pluginList)); assert (ex.getMessage().contains("Multiple identity plugins are not supported,")); + terminate(threadPool); } } diff --git a/server/src/test/java/org/opensearch/bootstrap/IdentityPluginTests.java b/server/src/test/java/org/opensearch/bootstrap/IdentityPluginTests.java index ae17a90cacc77..d4064dd7d3c1a 100644 --- a/server/src/test/java/org/opensearch/bootstrap/IdentityPluginTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/IdentityPluginTests.java @@ -31,6 +31,7 @@ public void testSingleIdentityPluginSucceeds() { IdentityService identityService1 = new IdentityService(Settings.EMPTY, threadPool, pluginList1); assertTrue(identityService1.getUserSubject().getPrincipal().getName().equalsIgnoreCase("Unauthenticated")); assertThat(identityService1.getTokenManager(), is(instanceOf(NoopTokenManager.class))); + terminate(threadPool); } public void testMultipleIdentityPluginsFail() { @@ -41,5 +42,6 @@ public void testMultipleIdentityPluginsFail() { List pluginList = List.of(identityPlugin1, identityPlugin2, identityPlugin3); Exception ex = assertThrows(OpenSearchException.class, () -> new IdentityService(Settings.EMPTY, threadPool, pluginList)); assert (ex.getMessage().contains("Multiple identity plugins are not supported,")); + terminate(threadPool); } }