diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorPartitionLifecycleTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorPartitionLifecycleTest.java index a06b85edb0ed5..ff8772dc0523c 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorPartitionLifecycleTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorPartitionLifecycleTest.java @@ -130,7 +130,11 @@ class TaskExecutorPartitionLifecycleTest { private Duration duration = Duration.ofSeconds(15); - private Duration longDuration = Duration.ofSeconds(30); + private static final Duration registrationTimeout = Duration.ofSeconds(1); + + private static final Duration assertNotCompleteDuration = Duration.ofMillis(50); + + private static final Duration longDuration = Duration.ofSeconds(3); private CompletableFuture disconnectTaskManagerFuture; @@ -352,7 +356,7 @@ void testEnableBatchJobRecoveryAndNotRetainPartitions() throws Exception { // the release action will delay releasePartitionsForJobFuture -> assertThatFuture(releasePartitionsForJobFuture) - .willNotCompleteWithin(duration) + .willNotCompleteWithin(assertNotCompleteDuration) .eventuallySucceeds() .isEqualTo(jobId)); } @@ -386,7 +390,7 @@ private void testJMCrashedAndPossibleRetainPartitions( Consumer> verifyAction) throws Exception { configuration.set(BatchExecutionOptions.JOB_RECOVERY_ENABLED, enableBatchJobRecovery); - configuration.set(TaskManagerOptions.REGISTRATION_TIMEOUT, duration); + configuration.set(TaskManagerOptions.REGISTRATION_TIMEOUT, registrationTimeout); // the slot time out will try to release partition again, and we should avoid it configuration.set(SLOT_TIMEOUT, Duration.ofMinutes(5));