tillrohrmann commented on a change in pull request #13859:
URL: https://github.com/apache/flink/pull/13859#discussion_r518189393



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
##########
@@ -962,30 +952,23 @@ public void testSlotRequestTimeoutWhenNoSlotOffering() 
throws Exception {
 
                        
jobMasterGateway.registerTaskManager(taskExecutorGateway.getAddress(), 
taskManagerUnresolvedLocation, testingTimeout).get();
 
-                       // wait for the slot request timeout
-                       final SlotRequest slotRequest = blockingQueue.take();
+                       // wait for the job to restart, due to the slot request 
timing out
+                       while 
(jobMasterGateway.requestJob(testingTimeout).join().getStatusTimestamp(JobStatus.RESTARTING)
 <= 0) {}

Review comment:
       This is a busy waiting loop, right? Maybe we can add a pause.

##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java
##########
@@ -962,30 +952,23 @@ public void testSlotRequestTimeoutWhenNoSlotOffering() 
throws Exception {
 
                        
jobMasterGateway.registerTaskManager(taskExecutorGateway.getAddress(), 
taskManagerUnresolvedLocation, testingTimeout).get();
 
-                       // wait for the slot request timeout
-                       final SlotRequest slotRequest = blockingQueue.take();
+                       // wait for the job to restart, due to the slot request 
timing out
+                       while 
(jobMasterGateway.requestJob(testingTimeout).join().getStatusTimestamp(JobStatus.RESTARTING)
 <= 0) {}

Review comment:
       You might also use `CommonTestUtils.waitUntilCondition`.




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

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


Reply via email to