diff --git a/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTests.java b/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTests.java index 8d033a6b90cbad7fc036fea5ce5471968e75283b..be1cd6c813521e700a48006c455e4cabef2ffa2f 100644 --- a/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTests.java +++ b/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTests.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; import java.util.logging.Logger; @@ -143,13 +144,18 @@ class NshmTests { * Test CONUS 2018 NSHM * * To run test: ./gradlew testConus2018 + * @throws InterruptedException */ @Test - final void testConus2018() throws IOException { - var service = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); + final void testConus2018() throws IOException, InterruptedException { + var cores = Runtime.getRuntime().availableProcessors(); + var service = Executors.newFixedThreadPool(cores); + CountDownLatch latch = new CountDownLatch(1); service.execute(() -> { NshmTestUtils.testNshm(NSHMS.get("nshm-conus-2018"), Optional.ofNullable(getSite())); + latch.countDown(); }); + latch.await(); } /**