From ca46f1d40cf41a69636a410ecc1494d86a73d674 Mon Sep 17 00:00:00 2001 From: fjy Date: Wed, 30 Dec 2015 21:37:15 -0800 Subject: [PATCH] attempt to fix transient tests again --- .../extraction/namespace/TestKafkaExtractionCluster.java | 7 +++++-- .../namespace/cache/JDBCExtractionNamespaceTest.java | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/kafka-extraction-namespace/src/test/java/io/druid/query/extraction/namespace/TestKafkaExtractionCluster.java b/extensions/kafka-extraction-namespace/src/test/java/io/druid/query/extraction/namespace/TestKafkaExtractionCluster.java index 26724d48f8d..38b9df8c2b8 100644 --- a/extensions/kafka-extraction-namespace/src/test/java/io/druid/query/extraction/namespace/TestKafkaExtractionCluster.java +++ b/extensions/kafka-extraction-namespace/src/test/java/io/druid/query/extraction/namespace/TestKafkaExtractionCluster.java @@ -408,15 +408,17 @@ public class TestKafkaExtractionCluster ) throws InterruptedException { - final Function extractionFn = lookup.get(namespace); + Function extractionFn = lookup.get(namespace); if (expected == null) { while (extractionFn.apply(key) != null) { Thread.sleep(100); + extractionFn = lookup.get(namespace); } } else { while (!expected.equals(extractionFn.apply(key))) { Thread.sleep(100); + extractionFn = lookup.get(namespace); } } @@ -431,10 +433,11 @@ public class TestKafkaExtractionCluster ) throws InterruptedException { - final Function> extractionFn = lookup.get(namespace); + Function> extractionFn = lookup.get(namespace); while (!extractionFn.apply(key).equals(expected)) { Thread.sleep(100); + extractionFn = lookup.get(namespace); } Assert.assertEquals("update check", expected, extractionFn.apply(key)); diff --git a/extensions/namespace-lookup/src/test/java/io/druid/server/namespace/cache/JDBCExtractionNamespaceTest.java b/extensions/namespace-lookup/src/test/java/io/druid/server/namespace/cache/JDBCExtractionNamespaceTest.java index 81d9ff10fee..e7295a78415 100644 --- a/extensions/namespace-lookup/src/test/java/io/druid/server/namespace/cache/JDBCExtractionNamespaceTest.java +++ b/extensions/namespace-lookup/src/test/java/io/druid/server/namespace/cache/JDBCExtractionNamespaceTest.java @@ -486,6 +486,7 @@ public class JDBCExtractionNamespaceTest // rely on test timeout to break out of this loop while (!extractionFn.apply(key).equals(expected)) { Thread.sleep(100); + extractionFn = fnCache.get(namespace); } Assert.assertEquals(