From 055d1da318d5aefb0ea930895df28c7b708da92c Mon Sep 17 00:00:00 2001 From: leventov Date: Mon, 8 Jun 2015 18:46:47 +0300 Subject: [PATCH] HCOLL-340 probable fix of segmentation fault in SanityCheck test --- .../map/ChronicleMapSanityCheckTest.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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); } - } + } }