You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by le...@apache.org on 2023/03/17 10:48:48 UTC

[flink] branch master updated: [FLINK-31489][sql-gateway][tests] Fix instable test OperationManagerTest.testCloseOperation

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

leonard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new ff08c7b1d7f [FLINK-31489][sql-gateway][tests] Fix instable test OperationManagerTest.testCloseOperation
ff08c7b1d7f is described below

commit ff08c7b1d7fb9334d624aa74bc5788d4d7ac1edc
Author: lincoln lee <li...@gmail.com>
AuthorDate: Fri Mar 17 18:48:35 2023 +0800

    [FLINK-31489][sql-gateway][tests] Fix instable test OperationManagerTest.testCloseOperation
    
    This closes #22199.
---
 .../table/gateway/service/operation/OperationManagerTest.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/operation/OperationManagerTest.java b/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/operation/OperationManagerTest.java
index 6ccdd0bd2b0..d734ad8afa3 100644
--- a/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/operation/OperationManagerTest.java
+++ b/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/operation/OperationManagerTest.java
@@ -186,7 +186,7 @@ class OperationManagerTest {
     }
 
     @Test
-    void testCloseOperation() throws Exception {
+    void testCloseOperation() {
         CountDownLatch endRunningLatch = new CountDownLatch(1);
         OperationHandle operationHandle =
                 operationManager.submitOperation(
@@ -196,9 +196,12 @@ class OperationManagerTest {
                         });
 
         threadFactory.newThread(() -> operationManager.closeOperation(operationHandle)).start();
-        operationManager.awaitOperationTermination(operationHandle);
 
-        assertThatThrownBy(() -> operationManager.getOperation(operationHandle))
+        assertThatThrownBy(
+                        () -> {
+                            operationManager.awaitOperationTermination(operationHandle);
+                            operationManager.getOperation(operationHandle);
+                        })
                 .satisfies(
                         FlinkAssertions.anyCauseMatches(
                                 SqlGatewayException.class,