Skip to content

Commit

Permalink
Merge pull request #23019 from Abacn/jdbctestspeed
Browse files Browse the repository at this point in the history
[Test] Decrease derby.locks.waitTimeout in jdbc unit test
  • Loading branch information
pabloem authored Sep 8, 2022
2 parents 9efa378 + 269e009 commit ab8a375
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.joda.time.Duration;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -53,6 +54,14 @@ public class JdbcIOExceptionHandlingParameterizedTest {
"org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:memory:testDB;create=true");
private static final DataSource DATA_SOURCE = DATA_SOURCE_CONFIGURATION.buildDatasource();

@BeforeClass
public static void beforeClass() {
// by default, derby uses a lock timeout of 60 seconds. In order to speed up the test
// and detect the lock faster, we decrease this timeout
System.setProperty("derby.locks.waitTimeout", "2");
System.setProperty("derby.stream.error.file", "build/derby.log");
}

@Parameterized.Parameters
public static Collection<Object[]> data() {
return Arrays.asList(
Expand Down

0 comments on commit ab8a375

Please sign in to comment.