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/16 21:05:41 UTC

[flink] branch release-1.14 updated (7e5ada5 -> 5a0609a)

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

roman pushed a change to branch release-1.14
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from 7e5ada5  [FLINK-24839][fs-connector] Increase Timeout of FsStreamingSinkITCaseBase to 240
     new 99bb454  [hotfix][tests] Make RpcEndpointTest more informative
     new 5a0609a  [FLINK-22419] Wait unlimited in RpcEndpointTest.testCallAsyncTimeout

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/flink/runtime/rpc/RpcEndpointTest.java | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

[flink] 01/02: [hotfix][tests] Make RpcEndpointTest more informative

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 99bb454485153a4943bf987c1e35a4dfa8cbbd98
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 87a18f7..abd020f 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
@@ -35,10 +35,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. */
@@ -371,9 +372,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);
         }

[flink] 02/02: [FLINK-22419] Wait unlimited in RpcEndpointTest.testCallAsyncTimeout

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5a0609aa55c3ea69746a27a19622d8c97da772f9
Author: Roman Khachatryan <kh...@gmail.com>
AuthorDate: Fri Nov 12 12:53:46 2021 +0100

    [FLINK-22419] Wait unlimited in RpcEndpointTest.testCallAsyncTimeout
---
 .../src/test/java/org/apache/flink/runtime/rpc/RpcEndpointTest.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 abd020f..eaf573d 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
@@ -361,13 +361,14 @@ public class RpcEndpointTest extends TestLogger {
             throws InterruptedException, ExecutionException, TimeoutException {
         final RpcEndpoint endpoint = new BaseEndpoint(rpcService);
         final Time timeout = Time.milliseconds(100);
+        CountDownLatch latch = new CountDownLatch(1);
         try {
             endpoint.start();
             final CompletableFuture<Throwable> throwableFuture =
                     endpoint.callAsync(
                                     () -> {
                                         endpoint.validateRunsInMainThread();
-                                        TimeUnit.MILLISECONDS.sleep(timeout.toMilliseconds() * 2);
+                                        latch.await();
                                         return 12345;
                                     },
                                     timeout)
@@ -377,6 +378,7 @@ public class RpcEndpointTest extends TestLogger {
             assertNotNull(throwable);
             assertThat(throwable, instanceOf(TimeoutException.class));
         } finally {
+            latch.countDown();
             RpcUtils.terminateRpcEndpoint(endpoint, TIMEOUT);
         }
     }