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

Apache9 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 481332eff66 HBASE-30255 Async archiving wal file causes TestLogRolling 
flaky (#8406)
481332eff66 is described below

commit 481332eff6633d3e6eafa7034bac763fac2f6019
Author: Duo Zhang <[email protected]>
AuthorDate: Thu Jun 25 22:49:19 2026 +0800

    HBASE-30255 Async archiving wal file causes TestLogRolling flaky (#8406)
    
    Signed-off-by: Xiao Liu <[email protected]>
    Signed-off-by: Dávid Paksy <[email protected]>
---
 .../hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java
index 31f3d20c3cf..4491027efe4 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestLogRolling.java
@@ -17,6 +17,7 @@
  */
 package org.apache.hadoop.hbase.regionserver.wal;
 
+import static org.awaitility.Awaitility.await;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.greaterThan;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -25,6 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
+import java.time.Duration;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -304,8 +306,13 @@ public abstract class AbstractTestLogRolling {
     log.rollWriter();
 
     // should have deleted all the rolled wal files
-    TEST_UTIL.waitFor(5000, () -> 
AbstractFSWALProvider.getNumRolledLogFiles(log) == 0);
-    assertEquals(0, AbstractFSWALProvider.getLogFileSize(log));
+    await().atMost(Duration.ofSeconds(15)).untilAsserted(() -> {
+      // we call archive log in a background thread but remove the log from 
wal file map in
+      // foreground, which means it is possible that when numRolledLogFiles 
reaches zero, the log
+      // file size is still greater than zero, so here we need to wait for 
them both.
+      assertEquals(0, AbstractFSWALProvider.getNumRolledLogFiles(log));
+      assertEquals(0, AbstractFSWALProvider.getLogFileSize(log));
+    });
   }
 
   protected String getName() {

Reply via email to