HBASE-30175 Upgrade hbase-server to use junit5 Part19#8278
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR continues the HBASE-30175 JUnit 5 migration for hbase-server replication tests by extracting shared replication test scaffolding into a new base class and converting a large set of tests from JUnit 4 constructs (rules/categories/Parameterized) to JUnit Jupiter equivalents (TestInfo/Tags/TestTemplate + HBaseParameterizedTestTemplate).
Changes:
- Introduced
TestReplicationBaseNoBeforeAllto share replication cluster/test utilities without forcing a@BeforeAllstartup hook. - Refactored
TestReplicationBaseto extend the new base and keep only cluster startup. - Migrated many replication-related tests to JUnit 5 (Tags, BeforeAll/AfterAll, TestInfo) and converted JUnit4 Parameterized tests to
@TestTemplatewith@HBaseParameterizedTestTemplate.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBaseNoBeforeAll.java | New shared replication test base extracted from TestReplicationBase (cluster management + helpers). |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationBase.java | Slimmed to startup-only base class extending the new “no BeforeAll” base. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SyncReplicationTestBase.java | Added JUnit Jupiter lifecycle annotations alongside existing JUnit4 ones. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStreamTestBase.java | Migrated JUnit4 TestName rule usage to JUnit5 TestInfo. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStreamDifferentCountsFSHLog.java | Converted JUnit4 Parameterized to @HBaseParameterizedTestTemplate + constructor args. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStreamDifferentCountsAsyncFSWAL.java | Converted JUnit4 Parameterized to @HBaseParameterizedTestTemplate + constructor args. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStreamDifferentCounts.java | Converted to JUnit5 @TestTemplate + constructor parameter injection. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStreamCompressionReset.java | Migrated assertions and lifecycle annotations to JUnit5, replaced Category with Tag. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntrySinkFilter.java | Migrated to JUnit5 Tags/TestInfo and updated assertion call patterns. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSyncReplicationShipperQuit.java | Migrated to JUnit5 Tags and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationEndpoint.java | Migrated to JUnit5 Tags/lifecycle and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestSerialReplicationChecker.java | Migrated to JUnit5 lifecycle + TestInfo for per-test naming. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicator.java | Switched to TestReplicationBaseNoBeforeAll and migrated to JUnit5 annotations/assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationWALEdits.java | Migrated to JUnit5 Tags/Test and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationValueCompressedWAL.java | Switched to TestReplicationBaseNoBeforeAll and migrated to JUnit5 annotations. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationThrottler.java | Migrated to JUnit5 Tags/Test and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java | Switched to TestReplicationBaseNoBeforeAll and migrated to JUnit5 Tags/TestInfo. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java | Migrated to JUnit5 lifecycle/TestInfo and Jupiter assertion style. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceLogQueue.java | Migrated to JUnit5 Tags and fixed comment style to Javadoc. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSource.java | Migrated to JUnit5 lifecycle/Tags and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java | Migrated to JUnit5 lifecycle/Tags and Jupiter fail. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationMarker.java | Migrated to JUnit5 lifecycle/Tags and modernized a few generics/casts. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationCompressedWAL.java | Switched to TestReplicationBaseNoBeforeAll and migrated to JUnit5 (but needs teardown fix). |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRegionReplicaReplication.java | Migrated to JUnit5 lifecycle/TestInfo and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRefreshRecoveredReplication.java | Switched to TestReplicationBaseNoBeforeAll and migrated to JUnit5 lifecycle/TestInfo. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRefreshPeerWhileRegionServerRestarts.java | Migrated to JUnit5 Tags/Test and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestRaceWhenCreatingReplicationSource.java | Migrated to JUnit5 lifecycle/Tags and minor cleanup. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetaRegionReplicaReplication.java | Migrated to JUnit5 lifecycle/TestInfo and Tags. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestHBaseInterClusterReplicationEndpointFilterEdits.java | Migrated to JUnit5 lifecycle/Tags and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestGlobalReplicationThrottler.java | Migrated to JUnit5 lifecycle/TestInfo and Tags. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestDumpReplicationQueues.java | Migrated to JUnit5 lifecycle/TestInfo and Tags. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestDrainReplicationQueuesForStandBy.java | Migrated to JUnit5 Tags/Test and Jupiter assertions. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestBasicWALEntryStreamFSHLog.java | Converted JUnit4 Parameterized to @HBaseParameterizedTestTemplate + constructor args. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestBasicWALEntryStreamAsyncFSWAL.java | Converted JUnit4 Parameterized to @HBaseParameterizedTestTemplate + constructor args. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestBasicWALEntryStream.java | Converted to JUnit5 @TestTemplate + constructor parameter injection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
55
to
58
| @AfterAll | ||
| public static void tearDownAfterClass() throws Exception { | ||
| TestReplicationBase.tearDownAfterClass(); | ||
| } |
liuxiaocs7
approved these changes
May 29, 2026
Apache9
added a commit
that referenced
this pull request
May 29, 2026
Signed-off-by: Xiao Liu <liuxiaocs@apache.org>
Apache9
added a commit
that referenced
this pull request
May 29, 2026
Signed-off-by: Xiao Liu <liuxiaocs@apache.org> (cherry picked from commit 8d39f9f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.