From d208dda7e79f9704bff0b0da6a62e09f04d93e0b Mon Sep 17 00:00:00 2001 From: Scott Marlow Date: Mon, 5 Jun 2023 14:51:23 -0400 Subject: [PATCH] HHH-16275 wait longer for LockTest.testLock*FkTarget to insert row on the database server to avoid occasional fail with timeout getting lock Signed-off-by: Scott Marlow --- .../test/java/org/hibernate/orm/test/jpa/lock/LockTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/lock/LockTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/lock/LockTest.java index 6ab897c0c8..70cea7a28a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/lock/LockTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/lock/LockTest.java @@ -1167,7 +1167,7 @@ public class LockTest extends BaseEntityManagerFunctionalTestCase { } } - @Test(timeout = 5 * 1000) //5 seconds + @Test(timeout = 70 * 1000) //70 seconds @TestForIssue( jiraKey = "HHH-13135" ) @SkipForDialect(value = { MySQLDialect.class, @@ -1191,7 +1191,7 @@ public class LockTest extends BaseEntityManagerFunctionalTestCase { assertEquals( "lock mode should be PESSIMISTIC_WRITE ", LockModeType.PESSIMISTIC_WRITE, _entityManager.getLockMode( lock2 ) ); doInJPA( this::entityManagerFactory, entityManager -> { - TransactionUtil.setJdbcTimeout( entityManager.unwrap( Session.class ) ); + TransactionUtil.setJdbcTimeout( entityManager.unwrap( Session.class ), 60*1000L ); // wait up to a minute LockReference ref = new LockReference( 1, "name" ); ref.setLock( entityManager.getReference( Lock.class, lock.getId() ) );