This is an automated email from the ASF dual-hosted git repository.
wchevreuil pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new fa75d8d0a96 HBASE-30166: Attempt to fix flakeyness in
TestPrefetchPersistence (#8252)
fa75d8d0a96 is described below
commit fa75d8d0a96af7c5d70e05ac1c2f2bba1425050e
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]>
---
.../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 7d981d79355..d8ec6796bba 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.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.TestTemplate;
@@ -127,15 +128,23 @@ public class TestPrefetchPersistence {
assertTrue(usedSize != 0);
assertTrue(bucketCache.fullyCachedFiles.containsKey(storeFile.getName()));
assertTrue(bucketCache.fullyCachedFiles.containsKey(storeFile2.getName()));
+ }
+
+ @AfterEach
+ 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++;
}
}