diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/AccessKeyAuthFilterIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/AccessKeyAuthFilterIT.java index 8088ed1..b95183d 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/AccessKeyAuthFilterIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/AccessKeyAuthFilterIT.java @@ -48,6 +48,7 @@ import org.apache.phoenix.ddb.rest.util.Constants; import org.apache.phoenix.end2end.ServerMetadataCacheTestImpl; import org.apache.phoenix.jdbc.PhoenixDriver; +import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.ServerUtil; import static org.apache.phoenix.query.BaseTest.setUpConfigForMiniCluster; @@ -89,9 +90,13 @@ public static void setUpBeforeClass() throws Exception { utility = new HBaseTestingUtility(conf); setUpConfigForMiniCluster(conf); utility.startMiniCluster(); - + String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); + String url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + conf.set(Constants.AUTH_CREDENTIAL_STORE_CLASS, TestCredentialStore.class.getName()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(conf); restServer.run(); serverAddress = restServer.getServerAddress(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BaseSegmentScanIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BaseSegmentScanIT.java index 750fbb6..4d15b59 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BaseSegmentScanIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BaseSegmentScanIT.java @@ -92,6 +92,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchGetItem2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchGetItem2IT.java index ac300ea..b72fba6 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchGetItem2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchGetItem2IT.java @@ -116,6 +116,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchGetItemIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchGetItemIT.java index f7a0257..a760b92 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchGetItemIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchGetItemIT.java @@ -81,6 +81,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchWriteItem2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchWriteItem2IT.java index 75b6ea2..24c666c 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchWriteItem2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchWriteItem2IT.java @@ -105,6 +105,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchWriteItemIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchWriteItemIT.java index 12e413b..195eebb 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchWriteItemIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BatchWriteItemIT.java @@ -83,6 +83,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BinaryEndToEndIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BinaryEndToEndIT.java index fa519b0..3e85e3d 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BinaryEndToEndIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BinaryEndToEndIT.java @@ -130,6 +130,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BinaryStreamsIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BinaryStreamsIT.java index 7470e24..b831d79 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BinaryStreamsIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/BinaryStreamsIT.java @@ -78,6 +78,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); phoenixDBClientV2 = LocalDynamoDB.createV2Client("http://" + restServer.getServerAddress()); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConditionalPutItem2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConditionalPutItem2IT.java index 4948577..19d3e5b 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConditionalPutItem2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConditionalPutItem2IT.java @@ -80,6 +80,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConditionalPutItemIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConditionalPutItemIT.java index 6830f1e..f069925 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConditionalPutItemIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConditionalPutItemIT.java @@ -91,6 +91,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConnectionConfigIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConnectionConfigIT.java index ebe96ea..70f975a 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConnectionConfigIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ConnectionConfigIT.java @@ -62,6 +62,7 @@ public static void initialize() throws Exception { utility.startMiniCluster(); String zkQuorum = "127.0.0.1:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); LOGGER.info("started {} on port {}", restServer.getClass().getName(), restServer.getPort()); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/CreateTableIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/CreateTableIT.java index bd5ad34..98914cf 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/CreateTableIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/CreateTableIT.java @@ -113,6 +113,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteItem2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteItem2IT.java index 91c25dc..8a2a561 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteItem2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteItem2IT.java @@ -94,6 +94,7 @@ public static void initialize() throws Exception { utility.startMiniCluster(); String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteItemIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteItemIT.java index 6265d34..259b899 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteItemIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteItemIT.java @@ -92,6 +92,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteTableIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteTableIT.java index b43d293..e2bd418 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteTableIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DeleteTableIT.java @@ -41,6 +41,7 @@ import org.apache.phoenix.ddb.rest.RESTServer; import org.apache.phoenix.end2end.ServerMetadataCacheTestImpl; import org.apache.phoenix.jdbc.PhoenixDriver; +import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.ServerUtil; import org.junit.Assert; @@ -70,6 +71,10 @@ public static void initialize() throws Exception { setUpConfigForMiniCluster(conf); utility.startMiniCluster(); + String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); + String url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + + TestUtils.awaitPhoenixReady(url); restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeContinuousBackupsIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeContinuousBackupsIT.java index 1bae2d6..090bd33 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeContinuousBackupsIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeContinuousBackupsIT.java @@ -86,6 +86,7 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeStreamIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeStreamIT.java index cce4974..44b6ea4 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeStreamIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeStreamIT.java @@ -106,6 +106,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeTableIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeTableIT.java index f45db9e..d39ebf0 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeTableIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/DescribeTableIT.java @@ -85,6 +85,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetItemIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetItemIT.java index 73fcc8f..531aada 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetItemIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetItemIT.java @@ -90,6 +90,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java index de49648..4e63322 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java @@ -121,6 +121,7 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsMultipleProducersIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsMultipleProducersIT.java index 6f910fc..f5f303f 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsMultipleProducersIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsMultipleProducersIT.java @@ -27,6 +27,7 @@ import org.apache.phoenix.jdbc.PhoenixTestDriver; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.thirdparty.com.google.common.collect.Maps; +import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.ReadOnlyProps; import org.apache.phoenix.util.ServerUtil; import org.junit.AfterClass; @@ -129,8 +130,12 @@ public static void initialize() throws Exception { setUpConfigForMiniCluster(conf, new ReadOnlyProps(props.entrySet().iterator())); utility.startMiniCluster(); + String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); + String url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsSequenceNumberIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsSequenceNumberIT.java index af63056..d45bd10 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsSequenceNumberIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsSequenceNumberIT.java @@ -104,6 +104,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsShardIteratorTypeIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsShardIteratorTypeIT.java index d8b9256..304d669 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsShardIteratorTypeIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsShardIteratorTypeIT.java @@ -103,6 +103,7 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsShardLineageIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsShardLineageIT.java index feb9220..c609679 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsShardLineageIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsShardLineageIT.java @@ -103,6 +103,7 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsStreamTypeIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsStreamTypeIT.java index 6856e4d..cbaa485 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsStreamTypeIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsStreamTypeIT.java @@ -124,6 +124,8 @@ public static void initialize() throws Exception { utility.startMiniCluster(); String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + DriverManager.registerDriver(new PhoenixTestDriver()); restServer = new RESTServer(utility.getConfiguration()); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsTTLExpiryIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsTTLExpiryIT.java index e0d9da2..10dd954 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsTTLExpiryIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsTTLExpiryIT.java @@ -112,6 +112,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetShardIteratorIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetShardIteratorIT.java index e861f5e..7949f3b 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetShardIteratorIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetShardIteratorIT.java @@ -103,6 +103,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/JMXMetricsIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/JMXMetricsIT.java index e74e56f..0a813f7 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/JMXMetricsIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/JMXMetricsIT.java @@ -75,6 +75,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ListStreamsIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ListStreamsIT.java index 847ce78..2dff001 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ListStreamsIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ListStreamsIT.java @@ -80,6 +80,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ListTablesIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ListTablesIT.java index ce10451..d40dd2e 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ListTablesIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ListTablesIT.java @@ -71,6 +71,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MappedTableIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MappedTableIT.java index 5033dd4..8628cf2 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MappedTableIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MappedTableIT.java @@ -89,6 +89,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MiscIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MiscIT.java index 67d20f5..14dea13 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MiscIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/MiscIT.java @@ -87,6 +87,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/PutItemIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/PutItemIT.java index 61739a4..ded36ae 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/PutItemIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/PutItemIT.java @@ -87,6 +87,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/Query2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/Query2IT.java index 6c948bd..b5837f1 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/Query2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/Query2IT.java @@ -84,6 +84,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIT.java index aa7c804..a128fc3 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIT.java @@ -80,6 +80,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex1IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex1IT.java index e44f3a4..2de3257 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex1IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex1IT.java @@ -81,6 +81,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex2IT.java index e966128..ff5a95e 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex2IT.java @@ -85,6 +85,8 @@ public static void initialize() throws Exception { utility.startMiniCluster(); String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + DriverManager.registerDriver(new PhoenixTestDriver()); restServer = new RESTServer(utility.getConfiguration()); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex3IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex3IT.java index fefeb64..c96ff3d 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex3IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex3IT.java @@ -86,6 +86,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex4IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex4IT.java index 51660c8..ff5ac61 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex4IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndex4IT.java @@ -77,6 +77,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndexExclusiveStartKeyIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndexExclusiveStartKeyIT.java index 8c60f1f..53b307a 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndexExclusiveStartKeyIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryIndexExclusiveStartKeyIT.java @@ -46,6 +46,7 @@ import org.apache.phoenix.end2end.ServerMetadataCacheTestImpl; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixTestDriver; +import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.ServerUtil; import static org.apache.phoenix.ddb.TestUtils.verifyItemsEqual; @@ -99,7 +100,11 @@ public static void setup() throws Exception { utility = new HBaseTestingUtility(conf); setUpConfigForMiniCluster(conf); utility.startMiniCluster(); + String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); + String url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); dynamoDbClient = LocalDynamoDbTestBase.localDynamoDb().createV2Client(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryProjectionIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryProjectionIT.java index 68b5743..baa9483 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryProjectionIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/QueryProjectionIT.java @@ -77,6 +77,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/RandomizedIndexParityIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/RandomizedIndexParityIT.java index bbd71c7..f0fc46a 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/RandomizedIndexParityIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/RandomizedIndexParityIT.java @@ -107,6 +107,9 @@ public static void initialize() throws Exception { utility.startMiniCluster(); DriverManager.registerDriver(new PhoenixTestDriver()); + String url = "jdbc:phoenix:localhost:" + utility.getZkCluster().getClientPort(); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ReturnItemsLimitIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ReturnItemsLimitIT.java index 409acfc..c20bb44 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ReturnItemsLimitIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ReturnItemsLimitIT.java @@ -109,6 +109,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanExclusiveStartKeyIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanExclusiveStartKeyIT.java index 66fbf1c..ccda4b8 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanExclusiveStartKeyIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanExclusiveStartKeyIT.java @@ -150,6 +150,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndex2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndex2IT.java index 23fc0ba..9a6c4e7 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndex2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndex2IT.java @@ -86,6 +86,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndex3IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndex3IT.java index fceca52..733c940 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndex3IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndex3IT.java @@ -81,6 +81,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndexExclusiveStartKeyIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndexExclusiveStartKeyIT.java index 58b20c3..dd8d594 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndexExclusiveStartKeyIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndexExclusiveStartKeyIT.java @@ -156,6 +156,7 @@ public static void initialize() throws Exception { String url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndexIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndexIT.java index 877ca71..d707947 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndexIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanIndexIT.java @@ -78,6 +78,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanTable2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanTable2IT.java index c3ce5ed..6bf9187 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanTable2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanTable2IT.java @@ -82,6 +82,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanTableIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanTableIT.java index 2204710..a7b9b81 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanTableIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ScanTableIT.java @@ -80,6 +80,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/TimeToLiveIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/TimeToLiveIT.java index df85747..7c4c1e7 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/TimeToLiveIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/TimeToLiveIT.java @@ -88,6 +88,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateContinuousBackupsIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateContinuousBackupsIT.java index c1eda09..4a49335 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateContinuousBackupsIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateContinuousBackupsIT.java @@ -84,6 +84,8 @@ public static void initialize() throws Exception { utility.startMiniCluster(); String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + DriverManager.registerDriver(new PhoenixTestDriver()); restServer = new RESTServer(utility.getConfiguration()); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateExpressionValidationIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateExpressionValidationIT.java index d6f8b1c..22c44fe 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateExpressionValidationIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateExpressionValidationIT.java @@ -52,6 +52,7 @@ import org.apache.phoenix.ddb.rest.RESTServer; import org.apache.phoenix.end2end.ServerMetadataCacheTestImpl; import org.apache.phoenix.jdbc.PhoenixDriver; +import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.ServerUtil; import static org.apache.phoenix.query.BaseTest.setUpConfigForMiniCluster; @@ -83,6 +84,10 @@ public static void initialize() throws Exception { utility.startMiniCluster(); + String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); + String url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateItemBaseTests.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateItemBaseTests.java index aa085ed..b818311 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateItemBaseTests.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateItemBaseTests.java @@ -105,6 +105,8 @@ public static void initialize() throws Exception { url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateItemReturnValuesConcurrentIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateItemReturnValuesConcurrentIT.java index c6f2ec1..95b0e8a 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateItemReturnValuesConcurrentIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateItemReturnValuesConcurrentIT.java @@ -99,6 +99,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java index 4943d67..f53e492 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTable2IT.java @@ -91,6 +91,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTableIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTableIT.java index de8000b..67af22c 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTableIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/UpdateTableIT.java @@ -96,6 +96,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ValidationIT.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ValidationIT.java index 455b87e..cfb2db6 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ValidationIT.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/ValidationIT.java @@ -72,6 +72,8 @@ public static void initialize() throws Exception { String zkQuorum = "localhost:" + utility.getZkCluster().getClientPort(); url = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; + TestUtils.awaitPhoenixReady(url); + restServer = new RESTServer(utility.getConfiguration()); restServer.run(); diff --git a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/kcl/KclTestBase.java b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/kcl/KclTestBase.java index 468c4bd..47368e2 100644 --- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/kcl/KclTestBase.java +++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/kcl/KclTestBase.java @@ -116,13 +116,14 @@ public static void startCluster() throws Exception { jdbcUrl = PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum; DriverManager.registerDriver(new PhoenixTestDriver()); - restServer = new RESTServer(utility.getConfiguration()); - restServer.run(); - - // Probe Phoenix is queryable now that the REST server has bootstrapped it; absorbs - // the SYSTEM.CATALOG initialization race the first REST request would otherwise hit + // Probe Phoenix is queryable before starting REST server; absorbs + // the SYSTEM.CATALOG initialization race that validateConnection() would otherwise hit // on a slow CI worker. TestUtils.awaitPhoenixReady(jdbcUrl); + + restServer = new RESTServer(utility.getConfiguration()); + restServer.run(); + restEndpoint = "http://" + restServer.getServerAddress(); LOGGER.info("KclTestBase: REST server up at {}, DDB at {}", restEndpoint, LocalDynamoDbTestBase.localDynamoDb().getEndpoint());