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.
This commit is contained in:
parent
67d751d81d
commit
160f86a2f6
|
@ -34,7 +34,6 @@ import static org.junit.Assert.fail;
|
||||||
/**
|
/**
|
||||||
* @author Vlad Mihalcea
|
* @author Vlad Mihalcea
|
||||||
*/
|
*/
|
||||||
@SkipForDialect(value = CockroachDialect.class, comment = "See https://hibernate.atlassian.net/browse/HHH-15668")
|
|
||||||
public class BatchOptimisticLockingTest extends
|
public class BatchOptimisticLockingTest extends
|
||||||
BaseNonConfigCoreFunctionalTestCase {
|
BaseNonConfigCoreFunctionalTestCase {
|
||||||
|
|
||||||
|
@ -101,9 +100,10 @@ public class BatchOptimisticLockingTest extends
|
||||||
if ( getDialect() instanceof CockroachDialect ) {
|
if ( getDialect() instanceof CockroachDialect ) {
|
||||||
// CockroachDB always runs in SERIALIZABLE isolation, and uses SQL state 40001 to indicate
|
// CockroachDB always runs in SERIALIZABLE isolation, and uses SQL state 40001 to indicate
|
||||||
// serialization failure.
|
// serialization failure.
|
||||||
|
var msg = "org.hibernate.exception.LockAcquisitionException: could not execute batch";
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"org.hibernate.exception.LockAcquisitionException: could not execute batch",
|
"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 ) ) {
|
else if ( getDialect() instanceof OracleDialect && getDialect().getVersion().isBefore( 12 ) ) {
|
||||||
|
|
Loading…
Reference in New Issue