From 313d81ca2fb88a734f46e0e144d5a1a44ee1c4cd Mon Sep 17 00:00:00 2001 From: fjy Date: Thu, 13 Nov 2014 13:39:56 -0800 Subject: [PATCH 1/3] fix non-determininistic reference counting segment test --- .../io/druid/server/coordination/ServerManagerTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java b/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java index 72a15d993ac..34f1df0d218 100644 --- a/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java +++ b/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java @@ -315,7 +315,7 @@ public class ServerManagerTest ) ); - Assert.assertTrue("Operation must complete within 100ms", queryNotifyLatch.await(100, TimeUnit.MILLISECONDS)); + queryNotifyLatch.await(); Assert.assertEquals(1, factory.getSegmentReferences().size()); @@ -720,7 +720,7 @@ public class ServerManagerTest notifyLatch.countDown(); try { - waitYieldLatch.await(25, TimeUnit.MILLISECONDS); + waitYieldLatch.await(); } catch (Exception e) { throw Throwables.propagate(e); @@ -733,7 +733,7 @@ public class ServerManagerTest public OutType get() { try { - waitLatch.await(25, TimeUnit.MILLISECONDS); + waitLatch.await(); } catch (Exception e) { throw Throwables.propagate(e); From 0d275c7a53bf09edebee725b6139e446c65767b1 Mon Sep 17 00:00:00 2001 From: fjy Date: Thu, 20 Nov 2014 14:22:16 -0800 Subject: [PATCH 2/3] remove another wait --- .../java/io/druid/server/coordination/ServerManagerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java b/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java index 34f1df0d218..3c52714a240 100644 --- a/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java +++ b/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java @@ -276,7 +276,7 @@ public class ServerManagerTest ) ); - queryNotifyLatch.await(25, TimeUnit.MILLISECONDS); + queryNotifyLatch.await(); Assert.assertEquals(1, factory.getSegmentReferences().size()); From e044598669038213e810f83b429616a46183530d Mon Sep 17 00:00:00 2001 From: fjy Date: Thu, 20 Nov 2014 14:25:49 -0800 Subject: [PATCH 3/3] make wait timeout a bit longer --- .../druid/server/coordination/ServerManagerTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java b/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java index 3c52714a240..f6a139ffb9c 100644 --- a/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java +++ b/server/src/test/java/io/druid/server/coordination/ServerManagerTest.java @@ -276,7 +276,7 @@ public class ServerManagerTest ) ); - queryNotifyLatch.await(); + queryNotifyLatch.await(1000, TimeUnit.MILLISECONDS); Assert.assertEquals(1, factory.getSegmentReferences().size()); @@ -315,7 +315,7 @@ public class ServerManagerTest ) ); - queryNotifyLatch.await(); + queryNotifyLatch.await(1000, TimeUnit.MILLISECONDS); Assert.assertEquals(1, factory.getSegmentReferences().size()); @@ -358,7 +358,7 @@ public class ServerManagerTest ) ); - queryNotifyLatch.await(25, TimeUnit.MILLISECONDS); + queryNotifyLatch.await(1000, TimeUnit.MILLISECONDS); Assert.assertEquals(1, factory.getSegmentReferences().size()); @@ -392,7 +392,7 @@ public class ServerManagerTest private void waitForTestVerificationAndCleanup(Future future) { try { - queryNotifyLatch.await(25, TimeUnit.MILLISECONDS); + queryNotifyLatch.await(1000, TimeUnit.MILLISECONDS); queryWaitYieldLatch.countDown(); queryWaitLatch.countDown(); future.get(); @@ -720,7 +720,7 @@ public class ServerManagerTest notifyLatch.countDown(); try { - waitYieldLatch.await(); + waitYieldLatch.await(1000, TimeUnit.MILLISECONDS); } catch (Exception e) { throw Throwables.propagate(e); @@ -733,7 +733,7 @@ public class ServerManagerTest public OutType get() { try { - waitLatch.await(); + waitLatch.await(1000, TimeUnit.MILLISECONDS); } catch (Exception e) { throw Throwables.propagate(e);