Skip to content

test(processing): migrate segment tests to JUnit 5 - #19981

Open
FrankChen021 wants to merge 5 commits into
apache:masterfrom
FrankChen021:codex/junit5-processing-batch3
Open

test(processing): migrate segment tests to JUnit 5#19981
FrankChen021 wants to merge 5 commits into
apache:masterfrom
FrankChen021:codex/junit5-processing-batch3

Conversation

@FrankChen021

Copy link
Copy Markdown
Member

Fixes #13948.

Description

Migrate Batch 3 processing tests to the current JUnit 5 APIs while preserving test behavior and compatibility. This covers segment core, serialization, incremental indexes, and the index-merger hierarchy.

The migration uses TemporaryFolderExtension, CloserExtension, and LoggerCaptureExtension, retains the existing CloserRule compatibility test, and preserves the shared DruidExceptionMatcher and ExceptionMatcher APIs.

Scope

  • processing/src/test/java/org/apache/druid/segment core and index-merger tests
  • segment/column, segment/data, segment/generator, segment/incremental, segment/serde, segment/shim, segment/transform, segment/vector, and segment/writeout
  • No query files, shared helper changes, Batch 2 paths, CloserRule.java, or processing/pom.xml changes

Validation

  • mvn -ntp -pl processing -am test-compile -Dweb.console.skip=true -T1C — passed with Checkstyle, PMD, forbidden APIs, enforcer, and compilation checks
  • mvn -ntp -pl processing spotbugs:check -Dweb.console.skip=true — passed with 0 bugs and 0 errors (SpotBugs reported one missing optional MarkerManager class during analysis)
  • Focused Batch 3 migration tests — 112 tests passed, 0 failures, 1 intentionally disabled
  • git diff --check and scope audits — passed

The broader parameterized Schemaless run was not stable on the local OpenJDK 25 environment: it reproduced intermittent direct-buffer Unsafe SIGSEGVs and two parameterized-instance flakes that also occurred when the class was run in isolation. No source assertion failure was isolated.

Key changed/added classes in this PR

  • Segment core and index-merger tests
  • Column, data, incremental-index, serde, transform, vector, and writeout tests
  • CloserRuleTest compatibility coverage

This PR has:

  • been self-reviewed.
  • added or updated unit tests (existing tests migrated while preserving coverage).

Copilot AI lite review requested due to automatic review settings August 12, 2026 05:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@FrankChen021

Copy link
Copy Markdown
Member Author

Addressed the CodeQL array-bound finding in the current Batch 3 branch (head 98eab35): split the null and non-null loops so each array access is statically bounded by the corresponding array length. The focused FixedIndexedTest cases pass. The current token cannot execute GitHub inline review replies or resolveReviewThread, so this top-level response records the fix.

@FrankChen021

Copy link
Copy Markdown
Member Author

The targeted retry (workflow attempt 2) reproduced the same unrelated environment failure: SchemalessTestSimpleTest intermittently failed testFullOnTimeseries/testFullOnSearch, then the Zulu OpenJDK 25.0.4 VM terminated with SIGSEGV (exit 134). The migration change is not on this stack; I will make one further targeted retry after GitHub finalizes the run.

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity Findings
P0 0
P1 1
P2 0
P3 0
Total 1

Reviewed 56 of 56 changed files.


This is an automated review by Codex GPT-5.6-Luna(max)

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the code for correctness, edge cases, concurrency, and integration risks; no issues found.

Reviewed 55 of 55 changed files.


This is an automated review by Codex GPT-5.6-Luna(max)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JUnit4 to JUnit5 migration

3 participants