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

chengpan pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.7 by this push:
     new 90417497d [KYUUBI #4979] Fix flaky test: support to interrupt the 
thrift request if remote engine is broken
90417497d is described below

commit 90417497da243542126d71f3c48ca105cb6b0eca
Author: Cheng Pan <[email protected]>
AuthorDate: Mon Jun 19 16:04:59 2023 +0800

    [KYUUBI #4979] Fix flaky test: support to interrupt the thrift request if 
remote engine is broken
    
    ### _Why are the changes needed?_
    
    https://github.com/apache/kyuubi/actions/runs/5307034060/jobs/9605209396
    ```
    - support to interrupt the thrift request if remote engine is broken *** 
FAILED ***
      "org.apache.kyuubi.KyuubiSQLException: Error operating ExecuteStatement: 
Socket for SessionHandle [68f22014-c484-4279-8f79-81bd2e7f0eca] is closed" did 
not contain "java.net.SocketException", and 
"org.apache.kyuubi.KyuubiSQLException: Error operating ExecuteStatement: Socket 
for SessionHandle [68f22014-c484-4279-8f79-81bd2e7f0eca] is closed" did not 
contain "org.apache.thrift.transport.TTransportException", and 
"org.apache.kyuubi.KyuubiSQLException: Error operating ExecuteStatement: [...]
    ```
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
 locally before make a pull request
    
    Closes #4979 from pan3793/test-1.
    
    Closes #4979
    
    86807e751 [Cheng Pan] Fix flaky test: support to interrupt the thrift 
request if remote engine is broken
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit facbd78383678eb7092bd42be2e744b5fd05ff51)
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../kyuubi/operation/KyuubiOperationPerConnectionSuite.scala  | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerConnectionSuite.scala
 
b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerConnectionSuite.scala
index 977768312..b4ca842ed 100644
--- 
a/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerConnectionSuite.scala
+++ 
b/kyuubi-server/src/test/scala/org/apache/kyuubi/operation/KyuubiOperationPerConnectionSuite.scala
@@ -326,12 +326,11 @@ class KyuubiOperationPerConnectionSuite extends 
WithKyuubiServer with HiveJDBCTe
         val startTime = System.currentTimeMillis()
         val executeStmtResp = client.ExecuteStatement(executeStmtReq)
         assert(executeStmtResp.getStatus.getStatusCode === 
TStatusCode.ERROR_STATUS)
-        assert(executeStmtResp.getStatus.getErrorMessage.contains(
-          "java.net.SocketException") ||
-          executeStmtResp.getStatus.getErrorMessage.contains(
-            "org.apache.thrift.transport.TTransportException") ||
-          executeStmtResp.getStatus.getErrorMessage.contains(
-            "connection does not exist"))
+        val errorMsg = executeStmtResp.getStatus.getErrorMessage
+        assert(errorMsg.contains("java.net.SocketException") ||
+          errorMsg.contains("org.apache.thrift.transport.TTransportException") 
||
+          errorMsg.contains("connection does not exist") ||
+          errorMsg.contains(s"Socket for ${SessionHandle(handle)} is closed"))
         val elapsedTime = System.currentTimeMillis() - startTime
         assert(elapsedTime < 20 * 1000)
         eventually(timeout(3.seconds)) {

Reply via email to