Skip to content

Commit

Permalink
HHH-15668 Fix assertion in BatchOptimisticLockingTest
Browse files Browse the repository at this point in the history
Recent CockroachDB versions return a more detailed message. We now
test only the first part of the error message.
  • Loading branch information
maesenka authored and beikov committed Nov 24, 2022
1 parent 67d751d commit 160f86a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
/**
* @author Vlad Mihalcea
*/
@SkipForDialect(value = CockroachDialect.class, comment = "See https://hibernate.atlassian.net/browse/HHH-15668")
public class BatchOptimisticLockingTest extends
BaseNonConfigCoreFunctionalTestCase {

Expand Down Expand Up @@ -101,9 +100,10 @@ public void testBatchAndOptimisticLocking() {
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 ) ) {
Expand Down

0 comments on commit 160f86a

Please sign in to comment.