Skip to content

Commit

Permalink
Fix Thread leak
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Aug 17, 2024
1 parent 1536380 commit e6eb37e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import static java.util.Collections.singletonList;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.startsWith;
import static org.mockito.Mockito.mock;

public class ActionModuleTests extends OpenSearchTestCase {
public void testSetupActionsContainsKnownBuiltin() {
Expand Down Expand Up @@ -130,7 +131,6 @@ protected FakeAction() {
public void testSetupRestHandlerContainsKnownBuiltin() throws IOException {
SettingsModule settings = new SettingsModule(Settings.EMPTY);
UsageService usageService = new UsageService();
ThreadPool threadPool = new TestThreadPool(getTestName());
ActionModule actionModule = new ActionModule(
settings.getSettings(),
new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)),
Expand All @@ -143,8 +143,8 @@ public void testSetupRestHandlerContainsKnownBuiltin() throws IOException {
null,
usageService,
null,
new IdentityService(Settings.EMPTY, threadPool, new ArrayList<>()),
new ExtensionsManager(Set.of(), new IdentityService(Settings.EMPTY, threadPool, List.of()))
new IdentityService(Settings.EMPTY, mock(ThreadPool.class), new ArrayList<>()),
new ExtensionsManager(Set.of(), new IdentityService(Settings.EMPTY, mock(ThreadPool.class), List.of()))
);
actionModule.initRestHandlers(null);
// At this point the easiest way to confirm that a handler is loaded is to try to register another one on top of it and to fail
Expand Down

0 comments on commit e6eb37e

Please sign in to comment.