From 2c3c4a3f8f702cce99bbd7696850341b6503613f Mon Sep 17 00:00:00 2001 From: "navis.ryu" Date: Wed, 23 Dec 2015 17:25:08 +0900 Subject: [PATCH] Another try to fix xxServerViewTests --- .../java/io/druid/indexing/overlord/RemoteTaskRunnerTest.java | 1 + .../io/druid/indexing/overlord/http/OverlordResourceTest.java | 1 + .../java/io/druid/indexing/worker/WorkerTaskMonitorTest.java | 1 + .../java/io/druid/indexing/worker/http/WorkerResourceTest.java | 1 + server/src/test/java/io/druid/client/BrokerServerViewTest.java | 1 + .../test/java/io/druid/client/CoordinatorServerViewTest.java | 1 + .../io/druid/client/client/BatchServerInventoryViewTest.java | 1 + .../test/java/io/druid/curator/announcement/AnnouncerTest.java | 3 +++ .../java/io/druid/curator/discovery/ServiceAnnouncerTest.java | 2 ++ .../druid/curator/inventory/CuratorInventoryManagerTest.java | 2 ++ .../java/io/druid/server/coordination/ZkCoordinatorTest.java | 1 + .../coordination/BatchDataSegmentAnnouncerTest.java | 1 + .../java/io/druid/server/coordinator/DruidCoordinatorTest.java | 1 + .../java/io/druid/server/coordinator/LoadQueuePeonTest.java | 1 + 14 files changed, 18 insertions(+) diff --git a/indexing-service/src/test/java/io/druid/indexing/overlord/RemoteTaskRunnerTest.java b/indexing-service/src/test/java/io/druid/indexing/overlord/RemoteTaskRunnerTest.java index 576807fd97c..9d19752faea 100644 --- a/indexing-service/src/test/java/io/druid/indexing/overlord/RemoteTaskRunnerTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/overlord/RemoteTaskRunnerTest.java @@ -99,6 +99,7 @@ public class RemoteTaskRunnerTest .compressionProvider(new PotentiallyGzippedCompressionProvider(false)) .build(); cf.start(); + cf.blockUntilConnected(); cf.create().creatingParentsIfNeeded().forPath(basePath); cf.create().creatingParentsIfNeeded().forPath(tasksPath); diff --git a/indexing-service/src/test/java/io/druid/indexing/overlord/http/OverlordResourceTest.java b/indexing-service/src/test/java/io/druid/indexing/overlord/http/OverlordResourceTest.java index f18f6ebe828..5987e60f5bf 100644 --- a/indexing-service/src/test/java/io/druid/indexing/overlord/http/OverlordResourceTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/overlord/http/OverlordResourceTest.java @@ -146,6 +146,7 @@ public class OverlordResourceTest IndexerZkConfig indexerZkConfig = new IndexerZkConfig(new ZkPathsConfig(), null, null, null, null, null); setupServerAndCurator(); curator.start(); + curator.blockUntilConnected(); curator.create().creatingParentsIfNeeded().forPath(indexerZkConfig.getLeaderLatchPath()); druidNode = new DruidNode("hey", "what", 1234); ServiceEmitter serviceEmitter = new NoopServiceEmitter(); diff --git a/indexing-service/src/test/java/io/druid/indexing/worker/WorkerTaskMonitorTest.java b/indexing-service/src/test/java/io/druid/indexing/worker/WorkerTaskMonitorTest.java index 1b1ccbbf71b..5d70f7a8874 100644 --- a/indexing-service/src/test/java/io/druid/indexing/worker/WorkerTaskMonitorTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/worker/WorkerTaskMonitorTest.java @@ -102,6 +102,7 @@ public class WorkerTaskMonitorTest .compressionProvider(new PotentiallyGzippedCompressionProvider(false)) .build(); cf.start(); + cf.blockUntilConnected(); cf.create().creatingParentsIfNeeded().forPath(basePath); worker = new Worker( diff --git a/indexing-service/src/test/java/io/druid/indexing/worker/http/WorkerResourceTest.java b/indexing-service/src/test/java/io/druid/indexing/worker/http/WorkerResourceTest.java index f5da72a9652..edfce8a296a 100644 --- a/indexing-service/src/test/java/io/druid/indexing/worker/http/WorkerResourceTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/worker/http/WorkerResourceTest.java @@ -66,6 +66,7 @@ public class WorkerResourceTest .compressionProvider(new PotentiallyGzippedCompressionProvider(false)) .build(); cf.start(); + cf.blockUntilConnected(); cf.create().creatingParentsIfNeeded().forPath(basePath); worker = new Worker( diff --git a/server/src/test/java/io/druid/client/BrokerServerViewTest.java b/server/src/test/java/io/druid/client/BrokerServerViewTest.java index 6298ecba363..fd3fb91d75f 100644 --- a/server/src/test/java/io/druid/client/BrokerServerViewTest.java +++ b/server/src/test/java/io/druid/client/BrokerServerViewTest.java @@ -81,6 +81,7 @@ public class BrokerServerViewTest extends CuratorTestBase { setupServerAndCurator(); curator.start(); + curator.blockUntilConnected(); } @Test diff --git a/server/src/test/java/io/druid/client/CoordinatorServerViewTest.java b/server/src/test/java/io/druid/client/CoordinatorServerViewTest.java index 3e01804df09..17636c03122 100644 --- a/server/src/test/java/io/druid/client/CoordinatorServerViewTest.java +++ b/server/src/test/java/io/druid/client/CoordinatorServerViewTest.java @@ -73,6 +73,7 @@ public class CoordinatorServerViewTest extends CuratorTestBase { setupServerAndCurator(); curator.start(); + curator.blockUntilConnected(); } @Test diff --git a/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java b/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java index d6f0d5bc027..df30f9abeff 100644 --- a/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java +++ b/server/src/test/java/io/druid/client/client/BatchServerInventoryViewTest.java @@ -96,6 +96,7 @@ public class BatchServerInventoryViewTest .compressionProvider(new PotentiallyGzippedCompressionProvider(true)) .build(); cf.start(); + cf.blockUntilConnected(); cf.create().creatingParentsIfNeeded().forPath(testBasePath); jsonMapper = new DefaultObjectMapper(); diff --git a/server/src/test/java/io/druid/curator/announcement/AnnouncerTest.java b/server/src/test/java/io/druid/curator/announcement/AnnouncerTest.java index 2c13f93861e..babd8935270 100644 --- a/server/src/test/java/io/druid/curator/announcement/AnnouncerTest.java +++ b/server/src/test/java/io/druid/curator/announcement/AnnouncerTest.java @@ -184,6 +184,7 @@ public class AnnouncerTest extends CuratorTestBase public void testCleansUpItsLittleTurdlings() throws Exception { curator.start(); + curator.blockUntilConnected(); Announcer announcer = new Announcer(curator, exec); final byte[] billy = "billy".getBytes(); @@ -209,6 +210,7 @@ public class AnnouncerTest extends CuratorTestBase public void testLeavesBehindTurdlingsThatAlreadyExisted() throws Exception { curator.start(); + curator.blockUntilConnected(); Announcer announcer = new Announcer(curator, exec); final byte[] billy = "billy".getBytes(); @@ -237,6 +239,7 @@ public class AnnouncerTest extends CuratorTestBase public void testLeavesBehindTurdlingsWhenToldTo() throws Exception { curator.start(); + curator.blockUntilConnected(); Announcer announcer = new Announcer(curator, exec); final byte[] billy = "billy".getBytes(); diff --git a/server/src/test/java/io/druid/curator/discovery/ServiceAnnouncerTest.java b/server/src/test/java/io/druid/curator/discovery/ServiceAnnouncerTest.java index 087ce8251b1..0210a58a790 100644 --- a/server/src/test/java/io/druid/curator/discovery/ServiceAnnouncerTest.java +++ b/server/src/test/java/io/druid/curator/discovery/ServiceAnnouncerTest.java @@ -46,6 +46,7 @@ public class ServiceAnnouncerTest extends CuratorTestBase public void testServiceAnnouncement() throws Exception { curator.start(); + curator.blockUntilConnected(); List serviceNames = ImmutableList.of( "druid/overlord", "druid/coordinator", @@ -79,6 +80,7 @@ public class ServiceAnnouncerTest extends CuratorTestBase public void testServiceAnnouncementFail() throws Exception { curator.start(); + curator.blockUntilConnected(); createAndAnnounceServices(ImmutableList.of("placeholder/\u0001")); } diff --git a/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java b/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java index 2383fdacef4..d64910b22cc 100644 --- a/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java +++ b/server/src/test/java/io/druid/curator/inventory/CuratorInventoryManagerTest.java @@ -66,6 +66,8 @@ public class CuratorInventoryManagerTest extends io.druid.curator.CuratorTestBas ); curator.start(); + curator.blockUntilConnected(); + manager.start(); Assert.assertTrue(Iterables.isEmpty(manager.getInventory())); diff --git a/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java b/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java index 0233a29c1a6..8c0fae715af 100644 --- a/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java +++ b/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java @@ -79,6 +79,7 @@ public class ZkCoordinatorTest extends CuratorTestBase { setupServerAndCurator(); curator.start(); + curator.blockUntilConnected(); try { infoDir = new File(File.createTempFile("blah", "blah2").getParent(), "ZkCoordinatorTest"); infoDir.mkdirs(); diff --git a/server/src/test/java/io/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java b/server/src/test/java/io/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java index feb3f43e17c..26d13af6baf 100644 --- a/server/src/test/java/io/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java +++ b/server/src/test/java/io/druid/server/coordination/coordination/BatchDataSegmentAnnouncerTest.java @@ -76,6 +76,7 @@ public class BatchDataSegmentAnnouncerTest .compressionProvider(new PotentiallyGzippedCompressionProvider(false)) .build(); cf.start(); + cf.blockUntilConnected(); cf.create().creatingParentsIfNeeded().forPath(testBasePath); jsonMapper = new DefaultObjectMapper(); diff --git a/server/src/test/java/io/druid/server/coordinator/DruidCoordinatorTest.java b/server/src/test/java/io/druid/server/coordinator/DruidCoordinatorTest.java index 7408afded84..a576c89be75 100644 --- a/server/src/test/java/io/druid/server/coordinator/DruidCoordinatorTest.java +++ b/server/src/test/java/io/druid/server/coordinator/DruidCoordinatorTest.java @@ -112,6 +112,7 @@ public class DruidCoordinatorTest extends CuratorTestBase EasyMock.replay(configManager); setupServerAndCurator(); curator.start(); + curator.blockUntilConnected(); curator.create().creatingParentsIfNeeded().forPath(LOADPATH); objectMapper = new DefaultObjectMapper(); druidCoordinatorConfig = new TestDruidCoordinatorConfig(new Duration(COORDINATOR_START_DELAY), new Duration(COORDINATOR_PERIOD), null, null, null, false, false); diff --git a/server/src/test/java/io/druid/server/coordinator/LoadQueuePeonTest.java b/server/src/test/java/io/druid/server/coordinator/LoadQueuePeonTest.java index bf040dc1053..d8a6e85b01b 100644 --- a/server/src/test/java/io/druid/server/coordinator/LoadQueuePeonTest.java +++ b/server/src/test/java/io/druid/server/coordinator/LoadQueuePeonTest.java @@ -64,6 +64,7 @@ public class LoadQueuePeonTest extends CuratorTestBase { setupServerAndCurator(); curator.start(); + curator.blockUntilConnected(); curator.create().creatingParentsIfNeeded().forPath(LOAD_QUEUE_PATH); loadQueueCache = new PathChildrenCache(