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

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


The following commit(s) were added to refs/heads/master by this push:
     new f15432e5a02 HBASE-30166 ADDENDUM TestPrefetchPersistence may still 
fail due to prefetch delay (#8333)
f15432e5a02 is described below

commit f15432e5a02185695f705c457de211cf706f032e
Author: Wellington Ramos Chevreuil <[email protected]>
AuthorDate: Thu Jun 11 19:35:54 2026 +0100

    HBASE-30166 ADDENDUM TestPrefetchPersistence may still fail due to prefetch 
delay (#8333)
    
    Co-authored-by: Claude Code Opus 4.6 <[email protected]>
    
    Signed-off-by: Dávid Paksy <[email protected]>
    Signed-off-by: Peng Lu <[email protected]>
---
 .../hbase/io/hfile/bucket/TestPrefetchPersistence.java     | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 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 620c153895a..3c94497b43c 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
@@ -32,11 +32,13 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseParameterizedTestTemplate;
 import org.apache.hadoop.hbase.HBaseTestingUtil;
 import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.Waiter;
 import org.apache.hadoop.hbase.fs.HFileSystem;
 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
 import org.apache.hadoop.hbase.io.hfile.HFile;
 import org.apache.hadoop.hbase.io.hfile.HFileContext;
 import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
+import org.apache.hadoop.hbase.io.hfile.PrefetchExecutor;
 import org.apache.hadoop.hbase.io.hfile.RandomKeyValueUtil;
 import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
 import org.apache.hadoop.hbase.testclassification.IOTests;
@@ -94,6 +96,8 @@ public class TestPrefetchPersistence {
   public void setup() throws IOException {
     conf = TEST_UTIL.getConfiguration();
     conf.setBoolean(CacheConfig.PREFETCH_BLOCKS_ON_OPEN_KEY, true);
+    conf.setInt(PrefetchExecutor.PREFETCH_DELAY, 0);
+    PrefetchExecutor.loadConfiguration(conf);
     testDir = TEST_UTIL.getDataTestDir();
     TEST_UTIL.getTestFileSystem().mkdirs(testDir);
     fs = HFileSystem.get(conf);
@@ -138,14 +142,8 @@ public class TestPrefetchPersistence {
   public void readStoreFile(Path storeFilePath) throws Exception {
     // Open the file
     HFile.Reader reader = HFile.createReader(fs, storeFilePath, cacheConf, 
true, conf);
-    int retries = 0;
-    while (
-      !reader.prefetchComplete()
-        && !bucketCache.fullyCachedFiles.containsKey(storeFilePath.getName()) 
&& retries < 5
-    ) {
-      Thread.sleep(500);
-      retries++;
-    }
+    Waiter.waitFor(conf, 30000, () -> reader.prefetchComplete()
+      || bucketCache.fullyCachedFiles.containsKey(storeFilePath.getName()));
   }
 
   public Path writeStoreFile(String fname) throws IOException {

Reply via email to