From 56b0698947c107f2c58b0042ad8fe2303203577d Mon Sep 17 00:00:00 2001 From: Himanshu Kandwal Date: Tue, 10 Oct 2023 11:32:48 -0700 Subject: [PATCH] [apache/helix] -- Added more cluster event types in case of No-Op. --- .../TestWagedInstanceCapacityManager.java | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/helix-core/src/test/java/org/apache/helix/controller/rebalancer/waged/TestWagedInstanceCapacityManager.java b/helix-core/src/test/java/org/apache/helix/controller/rebalancer/waged/TestWagedInstanceCapacityManager.java index 7549efd1287..2376100bee9 100644 --- a/helix-core/src/test/java/org/apache/helix/controller/rebalancer/waged/TestWagedInstanceCapacityManager.java +++ b/helix-core/src/test/java/org/apache/helix/controller/rebalancer/waged/TestWagedInstanceCapacityManager.java @@ -175,15 +175,36 @@ public void testShouldNoOp() { Mockito.when(dataProvider.getWagedInstanceCapacity()).thenReturn(instanceCapacity); Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( - dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.TaskCurrentStateChange))); + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.CustomizedStateChange))); Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( - dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.MessageChange))); + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.CustomizedViewChange))); + Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.CustomizeStateConfigChange))); + Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.ExternalViewChange))); + Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.IdealStateChange))); + Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.OnDemandRebalance))); Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.Resume))); + Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.RetryRebalance))); + Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.StateVerifier))); + Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.TargetExternalViewChange))); + Assert.assertTrue(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.TaskCurrentStateChange))); + Assert.assertFalse(WagedInstanceCapacityManager.shouldNoOp( dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.LiveInstanceChange))); Assert.assertFalse(WagedInstanceCapacityManager.shouldNoOp( dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.CurrentStateChange))); + Assert.assertFalse(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.MessageChange))); + Assert.assertFalse(WagedInstanceCapacityManager.shouldNoOp( + dataProvider, _resourceMap, new ClusterEvent(ClusterEventType.PeriodicalRebalance))); } // -- static helpers