XComp commented on code in PR #24489:
URL: https://github.com/apache/flink/pull/24489#discussion_r1524962085


##########
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java:
##########
@@ -2097,6 +2098,87 @@ public void 
testResourceRequirementsAreRequestedFromTheScheduler() throws Except
         }
     }
 
+    @Test
+    public void 
testJobMasterDoesNotReconnectToResourceManagerEvenIfCleanupStalls()
+            throws Exception {
+
+        // the ResourceManager should count the connect attempts
+        final TestingResourceManagerGateway resourceManagerGateway =
+                createAndRegisterTestingResourceManagerGateway();
+        final AtomicInteger connectCount = new AtomicInteger();
+        final OneShotLatch firstRegistrationLatch = new OneShotLatch();
+        resourceManagerGateway.setRegisterJobManagerFunction(
+                (jobMasterId, resourceID, s, jobID) -> {
+                    connectCount.incrementAndGet();
+                    firstRegistrationLatch.trigger();
+
+                    return CompletableFuture.completedFuture(
+                            
resourceManagerGateway.getJobMasterRegistrationSuccess());
+                });
+
+        // the scheduler close logic should be handled outside the main thread

Review Comment:
   You're right - the comment is not really helpful because the intention of 
the future is documented further down in the test method where the 
`schedulerCloseFuture` is actually completed.



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