HBASE-30136 Upgrade hbase-server to use junit5 Part15#8291
Open
liuxiaocs7 wants to merge 1 commit into
Open
Conversation
Member
liuxiaocs7
commented
May 30, 2026
- for branch-2.6
- see: HBASE-30136
There was a problem hiding this comment.
Pull request overview
This is part 15 of the JUnit 4 → JUnit 5 migration for hbase-server tests on branch-2.6 (HBASE-30136). It mechanically rewrites a large batch of region-server tests to use Jupiter API equivalents.
Changes:
- Replace JUnit 4 imports/annotations (
@Category,@ClassRule/HBaseClassTestRule,@Rule/TestName,@Before/@After,@Test(expected=…),Assert.*,Assume.*,@Ignore,@RunWith(Parameterized.class)) with JUnit 5 equivalents (@Tag(<category>.TAG),@BeforeEach/@AfterEach/@BeforeAll/@AfterAll,assertThrows,Assertions.*,Assumptions.*,@Disabled,@HBaseParameterizedTestTemplate/@ParameterizedClass). - Swap
TestNamerule for a name captured fromTestInfoin@BeforeEach; flip JUnit-4 assert-message-first signatures to Jupiter's message-last form. - Restructure
TestDefaultMemStore/TestCompactingMemStore/TestCompactingToCellFlatMapMemStorelifecycle intointernalSetUp/createChunkCreator/createMemStore/internalTearDownhooks; convertTestBulkloadBaseTemporaryFolderto a@TempDir File; inTestCleanupMetaWALchangetearDownfromshutdownMiniZKCluster()toshutdownMiniCluster(); reclassifyTestCompactingToCellFlatMapMemStorefromLargeTeststoMediumTests.
Reviewed changes
Copilot reviewed 56 out of 56 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| TestGetClosestAtOrBefore.java | JUnit5 migration; TestName → TestInfo |
| TestFSErrorsExposed.java | JUnit5 migration; Assume → Assumptions |
| TestFlushRegionEntry.java | JUnit5 migration; class/instance hooks |
| TestFlushLifeCycleTracker.java | JUnit5 migration |
| TestFailedAppendAndSync.java | JUnit5 migration; message arg reorder |
| TestEndToEndSplitTransaction.java | JUnit5 migration; assert message reorder |
| TestEncryptionRandomKeying.java | JUnit5 migration |
| TestEncryptionKeyRotation.java | JUnit5 migration |
| TestEncryptionDisabled.java | ExpectedException → assertThrows |
| TestDirectStoreSplitsMerges.java | JUnit5 migration |
| TestDeleteMobTable.java | JUnit5 migration; Assert.* → static asserts |
| TestDefaultStoreEngine.java | JUnit5 migration |
| TestDefaultMemStore.java | New lifecycle hooks for parameterized subclasses |
| TestDefaultCompactSelection.java | JUnit5 migration |
| TestDateTieredCompactionPolicyOverflow.java | JUnit5 migration |
| TestDateTieredCompactionPolicyHeterogeneousStorage.java | JUnit5 migration |
| TestDateTieredCompactionPolicy.java | JUnit5 migration |
| TestDataTieringManager.java | JUnit5 migration |
| TestDataBlockEncodingTool.java | JUnit5 migration |
| TestCustomCellTieredCompactionPolicy.java | JUnit5 migration |
| TestCustomCellDataTieringManager.java | JUnit5 migration; Javadoc tweak |
| TestCompoundBloomFilter.java | JUnit5 migration |
| TestCompactSplitThread.java | try/fail → assertDoesNotThrow |
| TestCompactorMemLeak.java | JUnit5 migration |
| TestCompactionWithShippingCoprocessor.java | JUnit5 migration |
| TestCompactionWithCoprocessor.java | JUnit5 migration |
| TestCompactionWithByteBuff.java | JUnit5 migration |
| TestCompactionState.java | JUnit5 migration |
| TestCompactionPolicy.java | JUnit5 migration |
| TestCompactionLifeCycleTracker.java | JUnit5 migration; @Ignore → @Disabled |
| TestCompactionInDeadRegionServer.java | Parameterized → HBaseParameterizedTestTemplate |
| TestCompactionFileNotFound.java | JUnit5 migration; remove dead try/catch |
| TestCompactionArchiveIOException.java | JUnit5 migration |
| TestCompactionArchiveConcurrentClose.java | JUnit5 migration |
| TestCompactionAfterBulkLoad.java | Parameterized template; switch testFolder usage |
| TestCompaction.java | JUnit5 migration; Assume.assumeNoException → Assumptions.abort |
| TestCompactingToCellFlatMapMemStore.java | ParameterizedClass; category Large → Medium |
| TestCompactingMemStore.java | Restructure lifecycle to override hooks |
| TestColumnSeeking.java | JUnit5 migration |
| TestClusterId.java | JUnit5 migration |
| TestClearRegionBlockCache.java | Parameterized → HBaseParameterizedTestTemplate |
| TestCleanupMetaWAL.java | JUnit5 migration; tearDown now shutdownMiniCluster |
| TestCleanupCompactedFileOnRegionClose.java | JUnit5 migration |
| TestCleanupCompactedFileAfterFailover.java | JUnit5 migration |
| TestCellSkipListSet.java | JUnit5 migration |
| TestCellFlatSet.java | Parameterized template; assert reorder |
| TestCacheOnWriteInSchema.java | Parameterized template; cleanup |
| TestBytesReadServerSideScanMetrics.java | JUnit5 migration; Assert.* → static asserts |
| TestBulkloadBase.java | TemporaryFolder → @tempdir; parameters() helper |
| TestBulkLoad.java | @test(expected=…) → assertThrows |
| TestBrokenStoreFileCleaner.java | JUnit5 migration |
| TestBootstrapNodeManager.java | JUnit5 migration |
| TestBloomFilterFaulty.java | JUnit5 migration |
| TestBlocksScanned.java | JUnit5 migration |
| TestBlocksRead.java | JUnit5 migration; message reorder |
| TestAtomicOperation.java | JUnit5 migration; javadoc reference update |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.