HBASE-25361 [Flakey Tests] branch-2 TestMetaRegionLocationCache.testStandByMetaLocations (#2736)
Add a bit of a wait before testing if online replicas match the zk count. It might take a while for all replicas to come online. Signed-off-by: huaxiangsun <huaxiangsun@apache.org>
This commit is contained in:
parent
3ff115ebe4
commit
a0f4c28430
|
@ -98,6 +98,14 @@ public class TestMetaRegionLocationCache {
|
|||
assertFalse(metaHRLs.isEmpty());
|
||||
ZKWatcher zk = master.getZooKeeper();
|
||||
List<String> metaZnodes = zk.getMetaReplicaNodes();
|
||||
// Wait till all replicas available.
|
||||
while (master.getMetaRegionLocationCache().getMetaRegionLocations().get().size() !=
|
||||
metaZnodes.size()) {
|
||||
Thread.sleep(1000);
|
||||
if (++retries == 10) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
assertEquals(metaZnodes.size(), metaHRLs.size());
|
||||
List<HRegionLocation> actualHRLs = getCurrentMetaLocations(zk);
|
||||
Collections.sort(metaHRLs);
|
||||
|
|
Loading…
Reference in New Issue