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

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


The following commit(s) were added to refs/heads/master by this push:
     new 425ef83d948 Fix transaction deadlock assertion in different mysql 
versions (#34285)
425ef83d948 is described below

commit 425ef83d9483361edf136bf71445059259b55f95
Author: ZhangCheng <chengzh...@apache.org>
AuthorDate: Wed Jan 8 19:40:44 2025 +0800

    Fix transaction deadlock assertion in different mysql versions (#34285)
    
    * Fix transaction deadlock assertion in different mysql versions
    
    * Fix transaction deadlock assertion in different mysql versions
---
 .../e2e/transaction/cases/deadlock/TransactionDeadlockTestCase.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/deadlock/TransactionDeadlockTestCase.java
 
b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/deadlock/TransactionDeadlockTestCase.java
index 113ab464fcb..cfc376e46dd 100644
--- 
a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/deadlock/TransactionDeadlockTestCase.java
+++ 
b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/deadlock/TransactionDeadlockTestCase.java
@@ -33,7 +33,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 
-import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.containsString;
 import static org.hamcrest.MatcherAssert.assertThat;
 
 /**
@@ -79,7 +79,7 @@ public final class TransactionDeadlockTestCase extends 
BaseTransactionTestCase {
                 // CHECKSTYLE:OFF
             } catch (final Exception ex) {
                 // CHECKSTYLE:ON
-                assertThat(ex.getMessage(), 
is("com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait 
timeout exceeded; try restarting transaction"));
+                assertThat(ex.getMessage(), containsString("Lock wait timeout 
exceeded; try restarting transaction"));
             }
         }
         log.info("The deadlock test case execution time is: {}", 
System.currentTimeMillis() - startTime);

Reply via email to