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:39 UTC

[flink] branch release-1.12 updated (7b2ae80 -> c1f8e73)

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

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


    from 7b2ae80  [FLINK-24860][python] Fix the wrong position mappings in the Python UDTF
     new 9025168  [hotfix][tests] Make RpcEndpointTest more informative
     new c1f8e73  [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.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);
         }

[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.12
in repository https://gitbox.apache.org/repos/asf/flink.git

commit c1f8e731c8cb35c2e8a8b1294adc30312eac5349
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 204fe2a..787db95 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
@@ -376,13 +376,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)
@@ -392,6 +393,7 @@ public class RpcEndpointTest extends TestLogger {
             assertNotNull(throwable);
             assertThat(throwable, instanceOf(TimeoutException.class));
         } finally {
+            latch.countDown();
             RpcUtils.terminateRpcEndpoint(endpoint, TIMEOUT);
         }
     }