teamconfx opened a new pull request, #27462:
URL: https://github.com/apache/flink/pull/27462

   This PR fixes 
[FLINK-38872](https://issues.apache.org/jira/browse/FLINK-38872).
   
   
   
   ### Issue: 
   CommonTestUtils.waitForAllTaskRunning() could hang indefinitely if the job 
is lost, cancelled, or enters an unexpected terminal state.
   
   
   ### Changes Made:
   Added timeout parameters to waitUntilCondition and waitForAllTaskRunning 
methods.
   
   
     1. CommonTestUtils.java 
(flink-runtime/src/test/java/org/apache/flink/runtime/testutils/)
   
     Added:
     - DEFAULT_WAIT_FOR_TASKS_TIMEOUT constant (5 minutes) at line 75
     - New overload waitUntilCondition(condition, Duration timeout) at lines 
161-165
     - New overload waitUntilCondition(condition, Duration retryInterval, 
Duration timeout) at lines 167-180 - throws TimeoutException when deadline is 
exceeded
     - New overload waitForAllTaskRunning(MiniCluster, JobID, boolean, 
Duration) at lines 211-215
     - New overload 
waitForAllTaskRunning(SupplierWithException<AccessExecutionGraph>, boolean, 
Duration) at lines 230-269
     - New overload 
waitForAllTaskRunning(SupplierWithException<JobDetailsInfo>, Duration) at lines 
276-298
   
     Backward compatibility: Existing methods without timeout parameters now 
delegate to the new timeout-aware versions using DEFAULT_WAIT_FOR_TASKS_TIMEOUT.
   
     2. CommonTestUtilsTest.java (new file)
   
     Created unit tests to verify the timeout functionality:
     - testWaitUntilConditionWithTimeoutSucceeds - verifies successful 
completion
     - testWaitUntilConditionWithTimeoutThrowsOnTimeout - verifies 
TimeoutException is thrown
     - testWaitUntilConditionWithRetryIntervalAndTimeout - tests with custom 
retry interval
     - testWaitUntilConditionWithRetryIntervalAndTimeoutThrowsOnTimeout - 
verifies timeout with custom interval
   


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