diff --git a/test/framework/src/main/java/org/elasticsearch/test/transport/MockTransportService.java b/test/framework/src/main/java/org/elasticsearch/test/transport/MockTransportService.java index 4f30ce26ed056..8e10fd08c9d42 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/transport/MockTransportService.java +++ b/test/framework/src/main/java/org/elasticsearch/test/transport/MockTransportService.java @@ -83,6 +83,7 @@ import java.util.function.Supplier; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.spy; /** @@ -311,7 +312,7 @@ private MockTransportService( 4, 30, TimeUnit.SECONDS, - false, + true, EsExecutors.daemonThreadFactory("mock-transport"), threadPool.getThreadContext() ); @@ -809,7 +810,7 @@ protected void doClose() throws IOException { } catch (InterruptedException e) { throw new IllegalStateException(e); } finally { - ThreadPool.terminate(testExecutor, 10, TimeUnit.SECONDS); + assertTrue(ThreadPool.terminate(testExecutor, 10, TimeUnit.SECONDS)); } }