### Eclipse Workspace Patch 1.0 #P apache-hbase-trunk Index: hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (revision 1403987) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (working copy) @@ -1413,7 +1413,17 @@ Bytes.toString(tableName)); byte [] firstrow = metaRows.get(0); LOG.debug("FirstRow=" + Bytes.toString(firstrow)); + long startWait = System.currentTimeMillis(); + long timeoutMillis = 5000l; int index = getMiniHBaseCluster().getServerWith(firstrow); + while (index == -1) { + assertTrue( + "Timed out waiting for region " + Bytes.toStringBinary(firstrow) + + " online", + System.currentTimeMillis() - startWait < timeoutMillis); + index = getMiniHBaseCluster().getServerWith(firstrow); + Thread.sleep(200); + } return getMiniHBaseCluster().getRegionServerThreads().get(index).getRegionServer(); }