Index: src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java (revision 1439013) +++ src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java (working copy) @@ -25,6 +25,7 @@ import java.net.ConnectException; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -209,11 +210,13 @@ // So, do this in a thread and then reset meta location to break it out // of its wait after a bit of time. final AtomicBoolean metaSet = new AtomicBoolean(false); + final CountDownLatch latch = new CountDownLatch(1); Thread t = new Thread() { @Override public void run() { try { - metaSet.set(ct.waitForMetaServerConnection(100000) != null); + latch.await(); + metaSet.set(ct.waitForMeta(100000) != null); } catch (Exception e) { throw new RuntimeException(e); } @@ -221,7 +224,7 @@ }; t.start(); while(!t.isAlive()) Threads.sleep(1); - Threads.sleep(1); + latch.countDown(); // Now reset the meta as though it were redeployed. ct.setMetaLocation(SN); t.join();