Port nimbus_test.clj from Clojure to Java (Phase 7)#8453
Merged
jnioche merged 5 commits intoapache:masterfrom Mar 30, 2026
Merged
Port nimbus_test.clj from Clojure to Java (Phase 7)#8453jnioche merged 5 commits intoapache:masterfrom
jnioche merged 5 commits intoapache:masterfrom
Conversation
Port simple/unit-like Nimbus tests from storm-core/test/clj/org/apache/storm/nimbus_test.clj to storm-server/src/test/java/org/apache/storm/daemon/nimbus/NimbusClojurePortTest.java. Tests ported: testBogusId, testNimbusIfaceSubmitTopologyWithOptsChecksAuthorization, testNimbusIfaceMethodsCheckAuthorization, testNimbusIfaceGetTopologyMethodsThrowCorrectly, testNimbusIfaceGetClusterInfoFiltersToposWithoutBases, testValidateTopoConfigOnSubmit, testDebugOnComponent, testDebugOnGlobal, emptySaveConfigResultsInAllUnchangedActions, logLevelUpdateMergesAndFlagsExistentLogLevel, cleanupStormIdsReturnsInactiveTopos, cleanupStormIdsPerformsUnionOfStormIdsWithActiveZnodes, cleanupStormIdsReturnsEmptySetWhenAllToposAreActive. Skipped test-file-bogus-download (beginFileDownload API removed from Java). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add batch 7b tests: doCleanupRemovesInactiveZnodes, doCleanupDoesNotTeardownActiveTopos, userTopologiesForSupervisor, userTopologiesForSupervisorWithUnauthorizedUser, testCleanInbox, testSubmitInvalid. Total: 19 of 40 Nimbus tests ported. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…to-credentials tests Add 5 more tests from nimbus_test.clj: - testAssignment: basic topology assignment verification - testZeroExecutorOrTasks: validates zero executors/tasks handled correctly - testOverParallelismAssignment: verifies over-parallelism assignment behavior - testGetOwnerResourceSummaries: tests owner resource summary computation - testAutoCredentials: tests credential plugin lifecycle (populate, renew) Also adds MockAutoCred to storm-server test sources (duplicated from storm-core since storm-server cannot depend on storm-core test classes) and helper methods: fromJson, stormComponentToTaskInfo, stormNumWorkers, getCredentials, checkConsistency. Total: 24 tests passing (13 batch 7a + 6 batch 7b + 5 batch 7c). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… authorization tests Add 12 more tests from nimbus_test.clj: - testIsolatedAssignment: isolation scheduler with per-topology node allocation - testExecutorAssignments: executor-to-task distribution verification - testTopoHistory: topology history with per-user/group visibility - testKillStorm: full kill lifecycle with timeouts and kill options - testReassignment: executor heartbeat timeout and reassignment behavior - testReassignmentToConstrainedCluster: reassignment with limited resources - testReassignSqueezedTopology: progressive cluster expansion and rebalancing - testRebalance: basic rebalance across new supervisors - testRebalanceChangeParallelism: rebalance with worker/executor changes - testRebalanceConstrainedCluster: rebalance with port collision checks - testNimbusCheckAuthorizationParams: authorization param verification - testCheckAuthorizationGetSupervisorPageInfo: supervisor page auth checks Also adds helper methods: topologyNodes, topologySlots, topologyNodeDistribution, executorAssignment, executorStartTimes, topologyExecutors, slotAssignments, doExecutorHeartbeat, checkDistribution, checkExecutorDistribution, checkNumNodes, checkForCollisions, stormComponentToExecutorInfo, mkNimbus, waitForStatus. Skipped tests (require direct Nimbus+ZK construction that causes JVM crashes): - test-leadership, test-stateless-with-scheduled-topology-to-be-killed, test-topology-action-notifier Also skipped test-file-bogus-download (beginFileDownload API removed). Total: 36 tests passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rzo1
reviewed
Mar 29, 2026
storm-server/src/test/java/org/apache/storm/daemon/nimbus/NimbusClojurePortTest.java
Outdated
Show resolved
Hide resolved
…ion, and action notifier Uses real InProcessZookeeper instead of MockedZookeeper static mocking, avoiding the JVM crashes that previously prevented these tests from being ported. Also replaces Thread.sleep with Awaitility in waitForStatus helper. Part of apache#8445 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rzo1
approved these changes
Mar 29, 2026
rzo1
approved these changes
Mar 29, 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.
Summary
Port 39 tests from
storm-core/test/clj/org/apache/storm/nimbus_test.cljto Java/JUnit 5 instorm-server/src/test/java/org/apache/storm/daemon/nimbus/NimbusClojurePortTest.java.Part of #8445 — removing the Clojure dependency from the Apache Storm build.
Tests ported (39 total, in 5 batches):
Batch 7a (13 tests): testBogusId, testNimbusIfaceSubmitTopologyWithOptsChecksAuthorization, testNimbusIfaceMethodsCheckAuthorization, testNimbusIfaceGetTopologyMethodsThrowCorrectly, testNimbusIfaceGetClusterInfoFiltersToposWithoutBases, testValidateTopoConfigOnSubmit, testDebugOnComponent, testDebugOnGlobal, emptySaveConfigResultsInAllUnchangedActions, logLevelUpdateMergesAndFlagsExistentLogLevel, cleanupStormIdsReturnsInactiveTopos, cleanupStormIdsPerformsUnionOfStormIdsWithActiveZnodes, cleanupStormIdsReturnsEmptySetWhenAllToposAreActive
Batch 7b (6 tests): doCleanupRemovesInactiveZnodes, doCleanupDoesNotTeardownActiveTopos, userTopologiesForSupervisor, userTopologiesForSupervisorWithUnauthorizedUser, testCleanInbox, testSubmitInvalid
Batch 7c (5 tests): testAssignment, testZeroExecutorOrTasks, testOverParallelismAssignment, testGetOwnerResourceSummaries, testAutoCredentials
Batch 7d (12 tests): testIsolatedAssignment, testExecutorAssignments, testTopoHistory, testKillStorm, testReassignment, testReassignmentToConstrainedCluster, testReassignSqueezedTopology, testRebalance, testRebalanceChangeParallelism, testRebalanceConstrainedCluster, testNimbusCheckAuthorizationParams, testCheckAuthorizationGetSupervisorPageInfo
Batch 7e (3 tests): testLeadership, testStatelessWithScheduledTopologyToBeKilled, testTopologyActionNotifier — these were previously skipped because direct Nimbus+ZooKeeper construction with static mocking (
MockedZookeeper) caused JVM crashes. Ported by using realInProcessZookeeperand Mockito-based leader elector mocks instead.Tests not ported (1):
beginFileDownloadAPI has been removed from NimbusNew helper files:
MockAutoCred.java— duplicated from storm-core test sources (not on storm-server classpath)InMemoryTopologyActionNotifier.java— duplicated from storm-core test sourcesOther improvements:
Thread.sleepwith Awaitility in thewaitForStatushelperTest plan
mvn test -pl storm-server -Dtest=NimbusClojurePortTest🤖 Generated with Claude Code