HBASE-7687 TestCatalogTracker.testServerNotRunningIOException fails occasionally (Ted Yu)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1439180 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
275382a7c7
commit
72efa3a4aa
|
@ -22,6 +22,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
|
@ -230,18 +231,20 @@ public class TestCatalogTracker {
|
||||||
// So, do this in a thread and then reset meta location to break it out
|
// So, do this in a thread and then reset meta location to break it out
|
||||||
// of its wait after a bit of time.
|
// of its wait after a bit of time.
|
||||||
final AtomicBoolean metaSet = new AtomicBoolean(false);
|
final AtomicBoolean metaSet = new AtomicBoolean(false);
|
||||||
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
Thread t = new Thread() {
|
Thread t = new Thread() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
metaSet.set(ct.waitForMetaServerConnection(100000) != null);
|
latch.countDown();
|
||||||
|
metaSet.set(ct.waitForMeta(100000) != null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
t.start();
|
t.start();
|
||||||
while(!t.isAlive()) Threads.sleep(1);
|
latch.await();
|
||||||
Threads.sleep(1);
|
Threads.sleep(1);
|
||||||
// Now reset the meta as though it were redeployed.
|
// Now reset the meta as though it were redeployed.
|
||||||
ct.setMetaLocation(SN);
|
ct.setMetaLocation(SN);
|
||||||
|
|
Loading…
Reference in New Issue