Author: larsh
Date: Wed Apr 16 18:22:41 2014
New Revision: 1588015

URL: http://svn.apache.org/r1588015
Log:
HBASE-10988 Properly wait for server in TestThriftServerCmdLine.

Modified:
    
hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java

Modified: 
hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java
URL: 
http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java?rev=1588015&r1=1588014&r2=1588015&view=diff
==============================================================================
--- 
hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java
 (original)
+++ 
hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerCmdLine.java
 Wed Apr 16 18:22:41 2014
@@ -164,7 +164,11 @@ public class TestThriftServerCmdLine {
 
     thriftServer = new ThriftServer(TEST_UTIL.getConfiguration());
     startCmdLineThread(args.toArray(new String[0]));
-    Threads.sleepWithoutInterrupt(2000);
+    // wait up to 10s for the server to start
+    for (int i = 0; i < 100
+        && (thriftServer.serverRunner == null || 
thriftServer.serverRunner.tserver == null); i++) {
+      Thread.sleep(100);
+    }
 
     Class<? extends TServer> expectedClass = implType != null ?
         implType.serverClass : TBoundedThreadPoolServer.class;


Reply via email to