diff --git a/src/test/java/net/openhft/chronicle/map/ChronicleMapSanityCheckTest.java b/src/test/java/net/openhft/chronicle/map/ChronicleMapSanityCheckTest.java index bad05ab89..9854e87b6 100644 --- a/src/test/java/net/openhft/chronicle/map/ChronicleMapSanityCheckTest.java +++ b/src/test/java/net/openhft/chronicle/map/ChronicleMapSanityCheckTest.java @@ -109,12 +109,21 @@ public class ChronicleMapSanityCheckTest { } }, 0, consumerPeriod,consumerTimeUnit); - Thread.sleep(totalTestTimeMS); + Thread.sleep(totalTestTimeMS); - consumerExecutor.shutdown(); - producerExecutor.shutdown(); + consumerExecutor.shutdown(); + try { + consumerExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + producerExecutor.shutdown(); + try { + producerExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); + } catch (InterruptedException e) { + throw new RuntimeException(e); } - } + } }