frostruan commented on code in PR #4335:
URL: https://github.com/apache/hbase/pull/4335#discussion_r849598950


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNonMetaRegionLocator.java:
##########
@@ -460,4 +464,35 @@ public void testConcurrentUpdateCachedLocationOnError() 
throws Exception {
     IntStream.range(0, 100).parallel()
       .forEach(i -> locator.updateCachedLocationOnError(loc, new 
NotServingRegionException()));
   }
+
+  @Test
+  public void testCacheLocationWhenGetAllLocations() throws Exception {
+    createMultiRegionTable();
+    AsyncConnectionImpl conn = (AsyncConnectionImpl)
+      
ConnectionFactory.createAsyncConnection(TEST_UTIL.getConfiguration()).get();
+    conn.getRegionLocator(TABLE_NAME).getAllRegionLocations().get();
+    List<RegionInfo> regions = TEST_UTIL.getAdmin().getRegions(TABLE_NAME);
+    for (RegionInfo region : regions) {
+      assertNotNull(conn.getLocator().getRegionLocationInCache(TABLE_NAME, 
region.getStartKey()));
+    }
+  }
+
+  @Test
+  public void testCacheLocationExceptionallyWhenGetAllLocations() throws 
Exception {
+    createMultiRegionTable();
+    AsyncConnectionImpl conn = (AsyncConnectionImpl)
+      
ConnectionFactory.createAsyncConnection(TEST_UTIL.getConfiguration()).get();
+    AsyncConnectionImpl spyConn = Mockito.spy(conn);
+    Mockito.when(spyConn.getTable(TableName.META_TABLE_NAME))

Review Comment:
   Yes. The exception is still thrown by the current thread. **REALLY** Thanks 
for your patient reply. I'll try to fix this. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to