This is an automated email from the ASF dual-hosted git repository.

mapohl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new f45de0c6de8 [FLINK-33414] Fix the unstable test 
MiniClusterITCase.testHandleStreamingJobsWhenNotEnoughSlot
f45de0c6de8 is described below

commit f45de0c6de87c182a49f2a979884d3d2f66f870f
Author: jiangxin <[email protected]>
AuthorDate: Mon Jan 8 20:32:05 2024 +0800

    [FLINK-33414] Fix the unstable test 
MiniClusterITCase.testHandleStreamingJobsWhenNotEnoughSlot
---
 .../flink/runtime/minicluster/MiniClusterITCase.java       | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/MiniClusterITCase.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/MiniClusterITCase.java
index e18fe24281d..ba3ca9b5237 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/MiniClusterITCase.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/MiniClusterITCase.java
@@ -23,6 +23,7 @@ import org.apache.flink.api.common.JobSubmissionResult;
 import org.apache.flink.api.common.restartstrategy.RestartStrategies;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.JobManagerOptions;
+import org.apache.flink.configuration.ResourceManagerOptions;
 import org.apache.flink.runtime.client.JobExecutionException;
 import org.apache.flink.runtime.io.network.partition.ResultPartitionType;
 import org.apache.flink.runtime.jobgraph.DistributionPattern;
@@ -123,10 +124,19 @@ class MiniClusterITCase {
 
     private void runHandleJobsWhenNotEnoughSlots(final JobGraph jobGraph) 
throws Exception {
         final Configuration configuration = new Configuration();
+
+        // the slot timeout needs to be high enough to avoid causing 
TimeoutException
+        Duration slotRequestTimeout = Duration.ofNanos(Long.MAX_VALUE);
+
         // this triggers the failure for the default scheduler
-        configuration.setLong(JobManagerOptions.SLOT_REQUEST_TIMEOUT, 100L);
+        configuration.setLong(
+                JobManagerOptions.SLOT_REQUEST_TIMEOUT, 
slotRequestTimeout.toMillis());
         // this triggers the failure for the adaptive scheduler
-        configuration.set(JobManagerOptions.RESOURCE_WAIT_TIMEOUT, 
Duration.ofMillis(100));
+        configuration.set(JobManagerOptions.RESOURCE_WAIT_TIMEOUT, 
slotRequestTimeout);
+
+        // cluster startup relies on SLOT_REQUEST_TIMEOUT as a fallback if the 
following parameter
+        // is not set which causes the test to take longer
+        
configuration.set(ResourceManagerOptions.STANDALONE_CLUSTER_STARTUP_PERIOD_TIME,
 1L);
 
         final MiniClusterConfiguration cfg =
                 new MiniClusterConfiguration.Builder()

Reply via email to