Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

HHH-7347 fail test if it runs longer than 30 minutes to prevent hangs

  • Loading branch information...
commit 4b74517dcd607e5602fb747e529e2892ad03fa77 1 parent 7ed323a
@stliu stliu authored
View
5 hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseUnitTestCase.java
@@ -27,6 +27,9 @@
import org.jboss.logging.Logger;
import org.junit.After;
+import org.junit.Rule;
+import org.junit.rules.TestRule;
+import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper;
@@ -41,6 +44,8 @@
public abstract class BaseUnitTestCase {
private static final Logger log = Logger.getLogger( BaseUnitTestCase.class );
+ @Rule
+ public TestRule globalTimeout= new Timeout(30 * 60 * 1000); // no test should run longer than 30 minutes
@After
public void releaseTransactions() {
if ( JtaStatusHelper.isActive( TestingJtaPlatformImpl.INSTANCE.getTransactionManager() ) ) {
Please sign in to comment.
Something went wrong with that request. Please try again.