Skip to content

Port Clojure tests to Java: drpc_test, grouping_test (Phase 4)#8449

Open
jnioche wants to merge 1 commit intomasterfrom
port/clojure-tests-phase4
Open

Port Clojure tests to Java: drpc_test, grouping_test (Phase 4)#8449
jnioche wants to merge 1 commit intomasterfrom
port/clojure-tests-phase4

Conversation

@jnioche
Copy link
Copy Markdown
Contributor

@jnioche jnioche commented Mar 28, 2026

See #8445

Summary

  • Ports all 7 tests from drpc_test.clj and all 3 effective tests from grouping_test.clj to Java/JUnit 5
  • All Clojure defbolt macros replaced with Java inner classes (8 bolt implementations)
  • Duplicate test-field in Clojure (2nd overrides 1st) resolved to a single test

Tests ported

DRPCIntegrationTest (7 tests):

Test Coverage
testDrpcFlow Raw DRPCSpout + ReturnResults topology
testDrpcBuilder LinearDRPCTopologyBuilder
testDrpcCoordination Coordinated counting with partial-count + aggregator
testDrpcCoordinationTricky Multi-stage coordination with finishedId
testDrpcFailFinish FailedException in finishedId
testDrpcAttemptsTwoReconnectsInFailRequest DRPCSpout retry logic (Mockito)
testDrpcStopsRetryingAfterSuccessfulReconnect DRPCSpout retry logic (Mockito)

GroupingIntegrationTest (3 tests):

Test Coverage
testShuffle Shuffle grouping distributes evenly
testFieldGrouping Fields grouping with TestWordBytesCounter
testCustomGroupings NGrouping custom stream and JavaObject grouping

Part of the Clojure test migration effort (Phase 4 of #8445).

Test plan

  • mvn test -pl storm-server -Dtest="org.apache.storm.drpc.DRPCIntegrationTest,org.apache.storm.grouping.GroupingIntegrationTest" — all 10 tests pass
  • Verify existing tests still pass: mvn test -pl storm-server

🤖 Generated with Claude Code

Port 7 tests from storm-core/test/clj/org/apache/storm/drpc_test.clj to
storm-server/src/test/java/org/apache/storm/drpc/DRPCIntegrationTest.java:
- testDrpcFlow: raw DRPCSpout + ReturnResults topology
- testDrpcBuilder: LinearDRPCTopologyBuilder
- testDrpcCoordination: coordinated counting with partial-count + aggregator
- testDrpcCoordinationTricky: multi-stage coordination with finishedId
- testDrpcFailFinish: FailedException in finishedId
- testDrpcAttemptsTwoReconnectsInFailRequest: Mockito test for retry logic
- testDrpcStopsRetryingAfterSuccessfulReconnect: Mockito test for retry logic

Port 3 tests from storm-core/test/clj/org/apache/storm/grouping_test.clj to
storm-server/src/test/java/org/apache/storm/grouping/GroupingIntegrationTest.java:
- testShuffle: shuffle grouping distributes evenly
- testFieldGrouping: fields grouping with TestWordBytesCounter
- testCustomGroupings: NGrouping custom stream and JavaObject grouping

All Clojure defbolt macros replaced with Java inner classes.
Duplicate test-field in Clojure (2nd overrides 1st) resolved to single test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants