You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ma...@apache.org on 2022/12/01 07:39:54 UTC

[flink] branch release-1.16 updated: [FLINK-30138][runtime][test] Increases timeout to essentially wait forever for an expected Exception to be thrown

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

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


The following commit(s) were added to refs/heads/release-1.16 by this push:
     new 8f7c35ec0e4 [FLINK-30138][runtime][test] Increases timeout to essentially wait forever for an expected Exception to be thrown
8f7c35ec0e4 is described below

commit 8f7c35ec0e434d788ea0984b8918f1be3354596b
Author: Matthias Pohl <ma...@aiven.io>
AuthorDate: Wed Nov 30 11:50:52 2022 +0100

    [FLINK-30138][runtime][test] Increases timeout to essentially wait forever for an expected Exception to be thrown
    
    Signed-off-by: Matthias Pohl <ma...@aiven.io>
---
 .../flink/runtime/blob/BlobServerCleanupTest.java  | 23 +++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java
index 982df0c94c0..b1aa90c9069 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerCleanupTest.java
@@ -36,7 +36,6 @@ import javax.annotation.Nullable;
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.NoSuchFileException;
-import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -258,10 +257,13 @@ public class BlobServerCleanupTest extends TestLogger {
         testFailedCleanup(
                 new JobID(),
                 (testInstance, jobId, executor) ->
-                        assertThat(testInstance.globalCleanupAsync(new JobID(), executor))
-                                .failsWithin(Duration.ofMillis(100))
-                                .withThrowableOfType(ExecutionException.class)
-                                .withCauseInstanceOf(IOException.class),
+                        assertThatThrownBy(
+                                        () ->
+                                                testInstance
+                                                        .globalCleanupAsync(new JobID(), executor)
+                                                        .get())
+                                .isInstanceOf(ExecutionException.class)
+                                .hasCauseInstanceOf(IOException.class),
                 blobStore);
     }
 
@@ -279,10 +281,13 @@ public class BlobServerCleanupTest extends TestLogger {
         testFailedCleanup(
                 new JobID(),
                 (testInstance, jobId, executor) ->
-                        assertThat(testInstance.globalCleanupAsync(new JobID(), executor))
-                                .failsWithin(Duration.ofMillis(100))
-                                .withThrowableOfType(ExecutionException.class)
-                                .withCause(actualException),
+                        assertThatThrownBy(
+                                        () ->
+                                                testInstance
+                                                        .globalCleanupAsync(new JobID(), executor)
+                                                        .get())
+                                .isInstanceOf(ExecutionException.class)
+                                .hasCause(actualException),
                 blobStore);
     }