From 31ceae8a791c1a67dff21d8f5044ecbf686ecb81 Mon Sep 17 00:00:00 2001 From: Peter Somogyi Date: Tue, 4 Dec 2018 14:57:50 +0100 Subject: [PATCH] HBASE-21546 ConnectException in TestThriftHttpServer --- .../apache/hadoop/hbase/thrift/TestThriftHttpServer.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java index c5b305de86..85495af69c 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java @@ -43,7 +43,6 @@ import org.apache.thrift.protocol.TProtocol; import org.apache.thrift.transport.THttpClient; import org.apache.thrift.transport.TTransportException; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -186,11 +185,7 @@ public class TestThriftHttpServer { private void waitThriftServerStartup() throws Exception{ // wait up to 10s for the server to start - for (int i = 0; i < 100 - && ( thriftServer.serverRunner == null || thriftServer.serverRunner.httpServer == - null); i++) { - Thread.sleep(100); - } + HBaseTestingUtility.waitForHostPort(HConstants.LOCALHOST, port); } private void runThriftServer(int customHeaderSize) throws Exception { @@ -269,7 +264,7 @@ public class TestThriftHttpServer { } private void stopHttpServerThread() throws Exception { - LOG.debug("Stopping " + " Thrift HTTP server"); + LOG.debug("Stopping Thrift HTTP server"); thriftServer.stop(); httpServerThread.join(); if (httpServerException != null) { -- 2.19.1