jhungund commented on code in PR #6182:
URL: https://github.com/apache/hbase/pull/6182#discussion_r1735975999


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java:
##########
@@ -364,16 +366,20 @@ public void testPrefetchWithDelay() throws Exception {
     // Wait for 20 seconds, no thread should start prefetch
     Thread.sleep(20000);
     assertFalse("Prefetch threads should not be running at this point", 
reader.prefetchStarted());
-    while (!reader.prefetchStarted()) {
-      assertTrue("Prefetch delay has not been expired yet",
-        getElapsedTime(startTime) < PrefetchExecutor.getPrefetchDelay());
-    }
-    if (reader.prefetchStarted()) {
-      // Added some delay as we have started the timer a bit late.
+    long timeout = 10000;
+    while (!reader.prefetchStarted() && !reader.prefetchComplete()) {
+      // Wait until the prefetch is triggered.
       Thread.sleep(500);
-      assertTrue("Prefetch should start post configured delay",
-        getElapsedTime(startTime) > PrefetchExecutor.getPrefetchDelay());
+      if (timeout <= 0) break;
+      timeout -= 500;
     }
+    assertTrue(reader.prefetchStarted() || reader.prefetchComplete());
+
+    // Added some delay as we have started the timer a bit late.
+    Thread.sleep(500);

Review Comment:
   I will try to remove this one and check if the test passes.



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