Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
andreitokar committed Aug 22, 2023
1 parent 3f1be47 commit f85140a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions h2/src/test/org/h2/test/db/TestMultiThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ private void testConcurrentUpdate2() throws Exception {

private void testCheckConstraint() throws Exception {
deleteDb("checkConstraint");
try (Connection c = getConnection("checkConstraint")) {
try (Connection c = getConnection("checkConstraint;LOCK_TIMEOUT=10000")) {
Statement s = c.createStatement();
s.execute("CREATE TABLE TEST(ID INT PRIMARY KEY, A INT, B INT)");
PreparedStatement ps = c.prepareStatement("INSERT INTO TEST VALUES (?, ?, ?)");
Expand All @@ -470,7 +470,7 @@ private void testCheckConstraint() throws Exception {
threads[i] = new Thread() {
@Override
public void run() {
try (Connection c = getConnection("checkConstraint")) {
try (Connection c = getConnection("checkConstraint;LOCK_TIMEOUT=10000")) {
PreparedStatement ps = c.prepareStatement("UPDATE TEST SET A = ?, B = ? WHERE ID = ?");
Random r = new Random();
for (int i = 0; i < 1_000; i++) {
Expand Down

0 comments on commit f85140a

Please sign in to comment.