You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/12/05 16:57:38 UTC

[hbase] branch branch-2.4 updated: HBASE-25361 [Flakey Tests] branch-2 TestMetaRegionLocationCache.testStandByMetaLocations (#2736)

This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new a0f4c28  HBASE-25361 [Flakey Tests] branch-2 TestMetaRegionLocationCache.testStandByMetaLocations (#2736)
a0f4c28 is described below

commit a0f4c28430ca5057601d30e38905d09afab689be
Author: Michael Stack <sa...@users.noreply.github.com>
AuthorDate: Sat Dec 5 08:55:59 2020 -0800

    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 <hu...@apache.org>
---
 .../apache/hadoop/hbase/client/TestMetaRegionLocationCache.java   | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaRegionLocationCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaRegionLocationCache.java
index d42c124..577e15c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaRegionLocationCache.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaRegionLocationCache.java
@@ -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);