diff --git a/flink-runtime/src/test/scala/org/apache/flink/runtime/testingUtils/TestingCluster.scala b/flink-runtime/src/test/scala/org/apache/flink/runtime/testingUtils/TestingCluster.scala index 7b7750a4b117f..c72eb50228ff9 100644 --- a/flink-runtime/src/test/scala/org/apache/flink/runtime/testingUtils/TestingCluster.scala +++ b/flink-runtime/src/test/scala/org/apache/flink/runtime/testingUtils/TestingCluster.scala @@ -59,7 +59,7 @@ class TestingCluster( override def generateConfiguration(userConfig: Configuration): Configuration = { val cfg = new Configuration() cfg.setString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, "localhost") - cfg.setInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, NetUtils.getAvailablePort()) + cfg.setInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, 0) cfg.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 10) cfg.setInteger(ConfigConstants.JOB_MANAGER_WEB_PORT_KEY, -1) @@ -145,7 +145,7 @@ class TestingCluster( system, hostname, Some(tmActorName), - Some(createLeaderRetrievalService), + Some(createLeaderRetrievalService()), numTaskManagers == 1, classOf[TestingTaskManager]) }