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

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


The following commit(s) were added to refs/heads/branch-2.6 by this push:
     new 129f3ea1f65 HBASE-30166: Attempt to fix flakeyness in 
TestPrefetchPersistence (#8252)
129f3ea1f65 is described below

commit 129f3ea1f6512ab33a7c51c3ade17ce9c9fbbe89
Author: Wellington Ramos Chevreuil <[email protected]>
AuthorDate: Thu May 21 13:56:07 2026 +0100

    HBASE-30166: Attempt to fix flakeyness in TestPrefetchPersistence (#8252)
    
    Signed-off-by: Dávid Paksy <[email protected]>
    Signed-off-by: Andor Molnár <[email protected]>
    Change-Id: I8e88598c28c6b812eab707bdfe6166869ed7946f
---
 .../hbase/io/hfile/bucket/TestPrefetchPersistence.java    | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestPrefetchPersistence.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestPrefetchPersistence.java
index a2909c005fd..f69346cf615 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestPrefetchPersistence.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestPrefetchPersistence.java
@@ -41,6 +41,7 @@ import org.apache.hadoop.hbase.io.hfile.RandomKeyValueUtil;
 import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
 import org.apache.hadoop.hbase.testclassification.IOTests;
 import org.apache.hadoop.hbase.testclassification.LargeTests;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
@@ -133,15 +134,23 @@ public class TestPrefetchPersistence {
     assertTrue(usedSize != 0);
     assertTrue(bucketCache.fullyCachedFiles.containsKey(storeFile.getName()));
     assertTrue(bucketCache.fullyCachedFiles.containsKey(storeFile2.getName()));
+  }
+
+  @After
+  public void cleanup() {
     TEST_UTIL.cleanupTestDir();
   }
 
   public void readStoreFile(Path storeFilePath) throws Exception {
     // Open the file
     HFile.Reader reader = HFile.createReader(fs, storeFilePath, cacheConf, 
true, conf);
-    while (!reader.prefetchComplete()) {
-      // Sleep for a bit
-      Thread.sleep(1000);
+    int retries = 0;
+    while (
+      !reader.prefetchComplete()
+        && !bucketCache.fullyCachedFiles.containsKey(storeFilePath.getName()) 
&& retries < 5
+    ) {
+      Thread.sleep(500);
+      retries++;
     }
   }
 

Reply via email to