From 160f86a2f69345d1f0a9a0b6d581b7e65f982958 Mon Sep 17 00:00:00 2001 From: Karel Maesen Date: Wed, 23 Nov 2022 22:25:02 +0100 Subject: [PATCH] HHH-15668 Fix assertion in BatchOptimisticLockingTest Recent CockroachDB versions return a more detailed message. We now test only the first part of the error message. --- .../hibernate/orm/test/batch/BatchOptimisticLockingTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchOptimisticLockingTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchOptimisticLockingTest.java index c6c06f1083..a0eee558c1 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchOptimisticLockingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/batch/BatchOptimisticLockingTest.java @@ -34,7 +34,6 @@ import static org.junit.Assert.fail; /** * @author Vlad Mihalcea */ -@SkipForDialect(value = CockroachDialect.class, comment = "See https://hibernate.atlassian.net/browse/HHH-15668") public class BatchOptimisticLockingTest extends BaseNonConfigCoreFunctionalTestCase { @@ -101,9 +100,10 @@ public class BatchOptimisticLockingTest extends if ( getDialect() instanceof CockroachDialect ) { // CockroachDB always runs in SERIALIZABLE isolation, and uses SQL state 40001 to indicate // serialization failure. + var msg = "org.hibernate.exception.LockAcquisitionException: could not execute batch"; assertEquals( "org.hibernate.exception.LockAcquisitionException: could not execute batch", - expected.getMessage() + expected.getMessage().substring( 0, msg.length() ) ); } else if ( getDialect() instanceof OracleDialect && getDialect().getVersion().isBefore( 12 ) ) {