RocMarshal commented on code in PR #746:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/746#discussion_r1441407436


##########
flink-autoscaler-standalone/src/test/java/org/apache/flink/autoscaler/standalone/StandaloneAutoscalerExecutorTest.java:
##########
@@ -62,30 +62,38 @@ void testScaling(boolean throwExceptionWhileScale) throws 
Exception {
                 Collections.synchronizedList(new 
ArrayList<JobAutoScalerContext<JobID>>());
 
         var eventCollector = new TestingEventCollector<JobID, 
JobAutoScalerContext<JobID>>();
-        final Configuration conf = new Configuration();
+        final var conf = new Configuration();
         conf.set(CONTROL_LOOP_PARALLELISM, 1);
         var countDownLatch = new CountDownLatch(jobList.size());
+
+        final var jobAutoScaler =
+                new JobAutoScaler<JobID, JobAutoScalerContext<JobID>>() {
+                    @Override
+                    public void scale(JobAutoScalerContext<JobID> context) {
+                        actualScaleContexts.add(context);
+                        if (exceptionKeys.contains(context.getJobKey())) {
+                            throw new RuntimeException("Excepted exception.");
+                        }
+                    }
+
+                    @Override
+                    public void cleanup(JobID jobKey) {
+                        fail("Should be called.");
+                    }
+                };
+
         try (var autoscalerExecutor =
                 new StandaloneAutoscalerExecutor<>(
-                        conf,
-                        () -> jobList,
-                        eventCollector,
-                        new JobAutoScaler<>() {
-                            @Override
-                            public void scale(JobAutoScalerContext<JobID> 
context) {
-                                actualScaleContexts.add(context);
-                                countDownLatch.countDown();
-                                if 
(exceptionKeys.contains(context.getJobKey())) {
-                                    throw new RuntimeException("Excepted 
exception.");
-                                }
-                            }
+                        conf, () -> jobList, eventCollector, jobAutoScaler) {
+                    @Override
+                    protected void 
scalingSingleJob(JobAutoScalerContext<JobID> jobContext) {
+                        super.scalingSingleJob(jobContext);
+                        countDownLatch.countDown();
+                    }
+                }) {
 
-                            @Override
-                            public void cleanup(JobID jobKey) {
-                                fail("Should be called.");
-                            }
-                        })) {
             autoscalerExecutor.scaling();
+            // Wait for all scalings are finished.

Review Comment:
   ```suggestion
               // Wait for all scalings to go finished.
   ```



-- 
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