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 7d2cb3fb71f HBASE-30253 Do not add/remove peer between tests in
TestBulkLoadReplication#8404)
7d2cb3fb71f is described below
commit 7d2cb3fb71f50295fc8d0889d47e78054882e880
Author: Duo Zhang <[email protected]>
AuthorDate: Wed Jun 24 18:02:21 2026 +0800
HBASE-30253 Do not add/remove peer between tests in
TestBulkLoadReplication#8404)
Signed-off-by: Xiao Liu <[email protected]>
(cherry picked from commit 1517a07ac646e61c6f72e30ba4fe7451bd639e7c)
---
.../hbase/replication/TestBulkLoadReplication.java | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestBulkLoadReplication.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestBulkLoadReplication.java
index b347efa0286..799f70f1d8c 100644
---
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestBulkLoadReplication.java
+++
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestBulkLoadReplication.java
@@ -70,6 +70,7 @@ import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
@@ -131,8 +132,8 @@ public class TestBulkLoadReplication extends
TestReplicationBaseNoBeforeAll {
ReplicationPeerConfig peer1Config = getPeerConfigForCluster(UTIL1);
ReplicationPeerConfig peer2Config = getPeerConfigForCluster(UTIL2);
ReplicationPeerConfig peer3Config = getPeerConfigForCluster(UTIL3);
- // Setup following topology: "1 <-> 2 <-> 3", 1 -> 2 will be added by
setUpBase method in parent
- // class
+ // Set up following topology: "1 <-> 2 <-> 3"
+ UTIL1.getAdmin().addReplicationPeer(PEER_ID2, peer2Config);
UTIL2.getAdmin().addReplicationPeer(PEER_ID1, peer1Config);
// adds cluster3 as a remote peer on cluster2
UTIL2.getAdmin().addReplicationPeer(PEER_ID3, peer3Config);
@@ -163,13 +164,20 @@ public class TestBulkLoadReplication extends
TestReplicationBaseNoBeforeAll {
}
@BeforeEach
- public void resetBulkLoadCount() throws Exception {
- // removing the peer and adding again causing the previously completed
bulk load jobs getting
- // submitted again, so here we override the setUpBase and tearDownBase to
not adding/removing
- // peers between each tests, we will add peers in beforeAll
+ @Override
+ public void setUpBase() throws Exception {
+ // Removing the peer and adding it back causes previously completed
bulk-load jobs to be
+ // resubmitted. Override setUpBase/tearDownBase so we do not add/remove
peers between tests;
+ // peers are added once in @BeforeAll.
BULK_LOADS_COUNT = new AtomicInteger(0);
}
+ @AfterEach
+ @Override
+ public void tearDownBase() throws Exception {
+ // do not remove PEER_ID2
+ }
+
private static ReplicationPeerConfig
getPeerConfigForCluster(HBaseTestingUtility util) {
return
ReplicationPeerConfig.newBuilder().setClusterKey(util.getClusterKey()).setSerial(false)
.build();