shahrs87 commented on code in PR #5081:
URL: https://github.com/apache/hbase/pull/5081#discussion_r1130065792


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java:
##########
@@ -459,6 +460,20 @@ public void testUserRegionLockThrowsException() throws 
IOException, InterruptedE
 
       assertTrue(client1.getException() instanceof LockTimeoutException
         ^ client2.getException() instanceof LockTimeoutException);
+
+      // obtain the client metrics
+      MetricsConnection metrics = conn.getConnectionMetrics();
+      long queueCount = metrics.getUserRegionLockQueue().getCount();
+      assertTrue(queueCount == 2);
+
+      long timeoutCount = metrics.getUserRegionLockTimeout().getCount();
+      assertTrue(timeoutCount == 1);
+
+      long waitingTimerCount = 
metrics.getUserRegionLockWaitingTimer().getCount();
+      assertTrue(waitingTimerCount == 1);
+
+      long heldTimerCount = metrics.getUserRegionLockHeldTimer().getCount();

Review Comment:
   I understand that it is taking around 2 seconds on your machine. Are we 
using some EnvironmentEdgeMananger tricks to ensure that it will always take 
more than 2 seconds? If not then this will create flaky tests if we run the 
test in some powerful machine where it will take less than 2 seconds. @vli02 



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