gyfora commented on code in PR #796:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/796#discussion_r1520023441


##########
flink-autoscaler/src/test/java/org/apache/flink/autoscaler/ScalingExecutorTest.java:
##########
@@ -146,6 +150,55 @@ op1, evaluated(1, 70, 100),
         
assertFalse(ScalingExecutor.allVerticesWithinUtilizationTarget(evaluated, 
scalingSummary));
     }
 
+    @Test
+    public void testNoScaleDownOnZeroLowerUtilizationBoundary() throws 
Exception {
+        var conf = context.getConfiguration();
+        // Target utilization and boundary are identical
+        // which will set the scale down boundary to infinity
+        conf.set(AutoScalerOptions.TARGET_UTILIZATION, 0.6);
+        conf.set(AutoScalerOptions.TARGET_UTILIZATION_BOUNDARY, 0.6);
+
+        var vertex = new JobVertexID();
+        int parallelism = 100;
+        int expectedParallelism = 1;
+        int targetRate = 1000;
+        // Intentionally also set the true processing rate to infinity
+        // to test the boundaries of the scaling condition.
+        double trueProcessingRate = Double.POSITIVE_INFINITY;
+
+        var evaluated =
+                new EvaluatedMetrics(
+                        Map.of(vertex, evaluated(parallelism, targetRate, 
trueProcessingRate)),
+                        dummyGlobalMetrics);
+
+        // Verify precondition
+        var scalingSummary =
+                Map.of(
+                        vertex,
+                        new ScalingSummary(
+                                parallelism,
+                                expectedParallelism,
+                                evaluated.getVertexMetrics().get(vertex)));
+        assertTrue(
+                ScalingExecutor.allVerticesWithinUtilizationTarget(
+                        evaluated.getVertexMetrics(), scalingSummary));
+
+        // Execute the full scaling path
+        HashMap<JobVertexID, SortedMap<Instant, ScalingSummary>> 
scalingHistory = new HashMap<>();
+        Instant now = Instant.now();
+        JobTopology jobTopology =

Review Comment:
   you could use `var` on the left hand sides to make this shorter and 
consistent with the rest of the method



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to