bharathv commented on a change in pull request #1388: HBASE-24079 [Flakey 
Tests] Misc fixes and debug; fix BindException in…
URL: https://github.com/apache/hbase/pull/1388#discussion_r400458926
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistry.java
 ##########
 @@ -103,7 +104,17 @@ private static String generateDummyMastersList(int size) {
   @Test public void testRegistryRPCs() throws Exception {
     Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
     HMaster activeMaster = TEST_UTIL.getHBaseCluster().getMaster();
-    for (int numHedgedReqs = 1; numHedgedReqs <=3; numHedgedReqs++) {
+    final int size = activeMaster.getMetaRegionLocationCache().
+      getMetaRegionLocations().get().size();
+    // Add wait on all replicas being assigned before proceeding w/ test. 
Failed on occasion
+    // because not all replicas had made it up before test started.
+    TEST_UTIL.waitFor(10000,
+      () -> {
+        try (MasterRegistry registry = new MasterRegistry(conf)) {
+          return registry.getMetaRegionLocations().get().size() >= size;
 
 Review comment:
   this looks always true since the registry actually gets the count from 
activeMaster.getMetaRegionLocationCache()?
   
   I think the check should look something like 
activeMaster.getLocations().size() == NUM_REPLICAS? Actually we have a  utility 
for this somewhere..I'm not able to find it now..:(

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to