test(indexing-service): migrate ingestion and parallel tests to JUnit 5 - #19926
Open
FrankChen021 wants to merge 5 commits into
Open
test(indexing-service): migrate ingestion and parallel tests to JUnit 5#19926FrankChen021 wants to merge 5 commits into
FrankChen021 wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request continues the indexing-service JUnit 4 → JUnit 5 migration by updating ingestion-task and parallel-indexing test suites to JUnit Jupiter, modernizing assertions/lifecycle APIs, and aligning temporary-directory handling with Druid utilities.
Changes:
- Migrated ingestion/parallel-indexing tests from JUnit 4 to JUnit 5 (Jupiter annotations, assertions, parameterization, and timeout handling).
- Replaced JUnit 4 Rules (e.g.,
TemporaryFolder,ExpectedException,TestName, runner-based parameterization) with Jupiter equivalents and DruidFileUtilstemp-dir utilities. - Added
junit-jupiter-paramsandmockito-junit-jupitertest dependencies to support parameterized tests and Mockito Jupiter integration.
Reviewed changes
Copilot reviewed 63 out of 63 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/ShardSpecsTest.java | Switch assertions/annotations to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/RestoreTaskTest.java | Replace JUnit 4 assertions with Jupiter assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/RangePartitionCachingLocalSegmentAllocatorTest.java | Replace ExpectedException rule with assertThrows; migrate lifecycle annotations. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/MoveTaskTest.java | Replace JUnit 4 assertions with Jupiter assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/InputRowFilterTest.java | Migrate assertions and imports to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/IngestionTestBase.java | Replace TemporaryFolder rule with FileUtils-managed temp dirs; add Jupiter lifecycle; keep JUnit 4 lifecycle annotations for bridge compatibility. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/IndexTaskUtilsTest.java | Migrate Mockito runner to Mockito Jupiter extension; switch to Jupiter assertions/lifecycle. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/IndexTaskSerdeTest.java | Replace ExpectedException rule with assertThrows; migrate to Jupiter lifecycle and assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/concurrent/ConcurrentReplaceAndStreamingAppendTest.java | Migrate per-test setup/teardown to Jupiter; keep IngestionTestBase integration. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/ClientKillUnusedSegmentsTaskQuerySerdeTest.java | Migrate to Jupiter lifecycle and assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/TombstoneHelperTest.java | Replace JUnit 4 assertions with Jupiter assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/TaskMonitorTest.java | Migrate setup/teardown and assertions to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseSubTaskSpecTest.java | Migrate lifecycle and assertions to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/SinglePhaseParallelIndexingTest.java | Convert parameterized-runner usage to Jupiter class parameterization; update temp dir handling and assumptions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/SegmentAllocationRequestTest.java | Replace JUnit 4 assertions with Jupiter assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/RangePartitionTaskKillTest.java | Replace JUnit 4 timeouts with @Timeout; migrate lifecycle/assertions and temp dirs. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/RangePartitionMultiPhaseParallelIndexingTest.java | Convert runner-based parameterization and Hamcrest assertions to Jupiter APIs; use createTempDir helpers. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/RangePartitionAdjustingCorePartitionSizeTest.java | Convert parameterized runner to Jupiter class parameterization; replace temp folder usage. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PushedSegmentsReportTest.java | Update to JUnit Jupiter @Test. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PerfectRollupWorkerTaskTest.java | Replace ExpectedException rule with assertThrows; migrate to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialSegmentMergeIOConfigTest.java | Convert parameterized runner to Jupiter class parameterization; migrate lifecycle. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialSegmentMergeIngestionSpecTest.java | Convert parameterized runner to Jupiter class parameterization; migrate lifecycle/parameter injection. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialRangeSegmentGenerateTaskTest.java | Replace ExpectedException rule with assertThrows; migrate assertions to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialHashSegmentGenerateTaskTest.java | Replace Hamcrest and ExpectedException with Jupiter assertions and assertThrows. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialGenericSegmentMergeTaskTest.java | Convert parameterized runner to Jupiter class parameterization; replace ExpectedException with assertThrows. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionTaskTest.java | Replace rule-based temp dirs/exception/log capture with explicit Jupiter lifecycle + FileUtils; migrate assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionCardinalityTaskTest.java | Same migration pattern as distribution test: Jupiter lifecycle + FileUtils, assertThrows, and updated assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/PartialCompactionTest.java | Migrate lifecycle/assertions and temp directory creation to Jupiter + helpers. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexTuningConfigTest.java | Replace ExpectedException rule with assertThrows; migrate to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTaskTest.java | Convert nested parameterized runner usage and Hamcrest checks to Jupiter parameterization and assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTaskSerdeTest.java | Replace ExpectedException rule with assertThrows; migrate assertions to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTaskResourceTest.java | Replace JUnit 4 timeout and teardown with @Timeout/@AfterEach; migrate assertions to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTaskKillTest.java | Replace timeouts and teardown with Jupiter @Timeout/@AfterEach; migrate assertions to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexPhaseRunnerTest.java | Migrate lifecycle/temp dirs and assertions to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/MultiPhaseParallelIndexingWithNullColumnTest.java | Convert parameterized runner usage to Jupiter class parameterization; migrate assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/MultiPhaseParallelIndexingRowStatsTest.java | Replace @Ignore with @Disabled; migrate lifecycle to Jupiter; use temp-dir helper. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/iterator/RangePartitionIndexTaskInputRowIteratorBuilderTest.java | Replace Hamcrest + ExpectedException with Jupiter assertions and assertThrows. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/iterator/IndexTaskInputRowIteratorBuilderTestingFactory.java | Switch assertion import to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/iterator/DefaultIndexTaskInputRowIteratorBuilderTest.java | Replace rule-based exceptions with assertThrows; migrate assertions to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/HttpShuffleClientTest.java | Replace temp-folder rule with FileUtils temp dirs + @AfterEach; migrate exception checks to assertThrows. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/HashPartitionTaskKillTest.java | Replace timeouts with @Timeout; migrate setup/assertions and temp dirs. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/HashPartitionMultiPhaseParallelIndexingTest.java | Convert parameterized runner usage to Jupiter class parameterization; migrate assertions and temp dirs. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/HashPartitionCachingLocalSegmentAllocatorTest.java | Migrate lifecycle and assertions to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/HashPartitionAdjustingCorePartitionSizeTest.java | Convert parameterized runner usage to Jupiter class parameterization; migrate assertions and temp dirs. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/GenericPartitionStatTest.java | Migrate lifecycle and assertions to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/GenericPartitionLocationTest.java | Migrate lifecycle and assertions to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/distribution/StringSketchTest.java | Replace Hamcrest + ExpectedException with Jupiter assertions and assertThrows. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/distribution/StringSketchMergerTest.java | Replace ExpectedException rule with assertThrows; migrate lifecycle to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/distribution/ArrayOfStringTuplesSerDeTest.java | Migrate JUnit 4 assertions to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/distribution/ArrayOfStringsNullSafeSerdeTest.java | Migrate assertions and assertThrows usage to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/DimensionDistributionReportTest.java | Migrate lifecycle annotations to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/DimensionCardinalityReportTest.java | Replace logger rule with explicit lifecycle management; migrate assertions to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/DeepStorageShuffleClientTest.java | Replace temp-folder rule with FileUtils temp dirs + @AfterEach; migrate assertions. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/DeepStoragePartitionStatTest.java | Migrate lifecycle and assertions to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/DeepStoragePartitionLocationTest.java | Migrate lifecycle and assertions to JUnit Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java | Replace JUnit 4 rules (TemporaryFolder, TestName) with FileUtils temp dirs and TestInfo; migrate lifecycle to Jupiter. |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractMultiPhaseParallelIndexingTest.java | Migrate assertions to Jupiter (message/order adjustments). |
| indexing-service/src/test/java/org/apache/druid/indexing/common/task/ArchiveTaskTest.java | Replace JUnit 4 assertions with Jupiter assertions. |
| indexing-service/pom.xml | Add junit-jupiter-params and mockito-junit-jupiter test dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
FrankChen021
commented
Aug 8, 2026
FrankChen021
left a comment
Member
Author
There was a problem hiding this comment.
reviewed all changes made by codex, LGTM
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.
Summary
indexing-serviceto JUnit 5.IngestionTestBaseonly as a compatibility bridge for legacy tests outside this batch.Validation
ParallelIndexSupervisorTaskResourceTest: 1 test each, 0 failures/errors.git diff --checkpassed.Tracking
Part of #13948.
Related migration PRs: #19910, #19920, #19922, #19923, and #19925.