This is an automated email from the ASF dual-hosted git repository.
Apache9 pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.5 by this push:
new d0c6317c2fe HBASE-30255 Async archiving wal file causes TestLogRolling
flaky (#8406)
d0c6317c2fe is described below
commit d0c6317c2fe44a31df67702689b2013947eab3d6
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]>
(cherry picked from commit 481332eff6633d3e6eafa7034bac763fac2f6019)
---
.../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 b5ce51e5eac..a2e4d14eb39 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;
@@ -24,6 +25,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 org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.hbase.HBaseTestingUtility;
@@ -207,8 +209,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() {