From 63a461498b049ba8ae0b39b924b9bc514f0484da Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 12 Sep 2024 00:23:04 +1000 Subject: [PATCH] review comments --- .../elasticsearch/test/transport/MockTransportService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)); } }