Skip to content

Commit

Permalink
Fix transaction deadlock assertion in different mysql versions (#34285)
Browse files Browse the repository at this point in the history
* Fix transaction deadlock assertion in different mysql versions

* Fix transaction deadlock assertion in different mysql versions
  • Loading branch information
FlyingZC authored Jan 8, 2025
1 parent ea50147 commit 425ef83
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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;

/**
Expand Down Expand Up @@ -79,7 +79,7 @@ protected void executeTest(final TransactionContainerComposer containerComposer)
// 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);
Expand Down

0 comments on commit 425ef83

Please sign in to comment.