HBASE-30098 Rewrite RestoreSnapshotFromClientTestBase and its sub cla…#8107
Merged
Apache9 merged 2 commits intoapache:masterfrom Apr 24, 2026
Merged
HBASE-30098 Rewrite RestoreSnapshotFromClientTestBase and its sub cla…#8107Apache9 merged 2 commits intoapache:masterfrom
Apache9 merged 2 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR rewrites the RestoreSnapshotFromClient test hierarchy to use JUnit 5 style parameterized test templates (constructor-injected parameters via @HBaseParameterizedTestTemplate) instead of JUnit 4 Parameterized + rules, while keeping coverage for both normal and MOB snapshot restore scenarios.
Changes:
- Migrate leaf test classes from JUnit4
@RunWith(Parameterized.class)/@Categoryto JUnit5@HBaseParameterizedTestTemplate/@Tagwith constructor parameter injection. - Refactor
RestoreSnapshotFromClientTestBaseto carrynumReplicas, provide a sharedparameters()stream, and use JUnit5 lifecycle hooks (@BeforeEach/@AfterEach/@AfterAll) andTestInfofor unique per-invocation naming. - Update test base subclasses to use
@TestTemplatemethods and passnumReplicasthrough to snapshot/table helpers.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientSimple.java | Convert leaf test to JUnit5 template + constructor parameter. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientSchemaChange.java | Convert leaf test to JUnit5 template + constructor parameter. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientGetCompactionState.java | Convert leaf test to JUnit5 template + constructor parameter. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientClone.java | Convert leaf test to JUnit5 template + constructor parameter. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientAfterTruncate.java | Convert leaf test to JUnit5 template + constructor parameter. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestRestoreSnapshotFromClientAfterSplittingRegions.java | Convert leaf test to JUnit5 template + constructor parameter. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSimple.java | Convert MOB leaf test to JUnit5 template + constructor parameter; use numReplicas directly. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientSchemaChange.java | Convert MOB leaf test to JUnit5 template + constructor parameter; use numReplicas directly. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientGetCompactionState.java | Convert MOB leaf test to JUnit5 template + constructor parameter; use numReplicas directly. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientClone.java | Convert MOB leaf test to JUnit5 template + constructor parameter; use numReplicas directly. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterTruncate.java | Convert MOB leaf test to JUnit5 template + constructor parameter. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMobRestoreSnapshotFromClientAfterSplittingRegions.java | Convert MOB leaf test to JUnit5 template + constructor parameter. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientTestBase.java | Central refactor: JUnit5 lifecycle, shared parameters(), store numReplicas, use TestInfo for unique names. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientSimpleTestBase.java | Switch tests to @TestTemplate and use numReplicas. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientSchemaChangeTestBase.java | Switch tests to @TestTemplate and accept numReplicas via constructor. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientGetCompactionStateTestBase.java | Switch tests to @TestTemplate and accept numReplicas via constructor. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientCloneTestBase.java | Switch tests to @TestTemplate and use numReplicas. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterTruncateTestBase.java | Switch test to @TestTemplate and use numReplicas. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/client/RestoreSnapshotFromClientAfterSplittingRegionsTestBase.java | Switch test to @TestTemplate and accept numReplicas via constructor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
liuxiaocs7
approved these changes
Apr 22, 2026
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.
…sses