This is an automated email from the ASF dual-hosted git repository.
Apache9 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 4267d1cf60a HBASE-30255 Async archiving wal file causes TestLogRolling
flaky (#8406)
4267d1cf60a is described below
commit 4267d1cf60a5a4a9b67526a7aba3210f9302718a
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 2af0c204ed8..e8b6ede8fb4 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() {