You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ro...@apache.org on 2021/11/12 21:15:40 UTC
[flink] 01/02: [hotfix][tests] Make RpcEndpointTest more informative
This is an automated email from the ASF dual-hosted git repository.
roman pushed a commit to branch release-1.12
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 902516864d6e031c2aa71e89852c5e72308d22c1
Author: Roman Khachatryan <kh...@gmail.com>
AuthorDate: Fri Nov 12 12:53:02 2021 +0100
[hotfix][tests] Make RpcEndpointTest more informative
---
.../java/org/apache/flink/runtime/rpc/RpcEndpointTest.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rpc/RpcEndpointTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rpc/RpcEndpointTest.java
index d50fb67..204fe2a 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/rpc/RpcEndpointTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rpc/RpcEndpointTest.java
@@ -41,10 +41,11 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.BiConsumer;
+import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/** Tests for the RpcEndpoint, its self gateways and MainThreadExecutor scheduling command. */
@@ -386,9 +387,10 @@ public class RpcEndpointTest extends TestLogger {
},
timeout)
.handle((ignore, throwable) -> throwable);
- final Throwable throwable =
- throwableFuture.get(timeout.getSize() * 2, timeout.getUnit());
- assertTrue(throwable instanceof TimeoutException);
+ final Throwable throwable = throwableFuture.get();
+
+ assertNotNull(throwable);
+ assertThat(throwable, instanceOf(TimeoutException.class));
} finally {
RpcUtils.terminateRpcEndpoint(endpoint, TIMEOUT);
}