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:
Michael Stack 2020-12-05 08:55:59 -08:00 committed by GitHub
parent ea331a66be
commit a4d5b1bb88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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);