Skip to content

Commit 0f0d82e

Browse files
committed
attempt first to fix flaky test
1 parent ab67235 commit 0f0d82e

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,16 @@ public void testExecuteUpdateDates() throws Exception {
264264
}
265265
}
266266

267+
private static final int ASYNC_INSERT_SETTINGS_DP_ROWS = 1000_000;
268+
267269
@DataProvider(name = "asyncInsertSettingsDP")
268270
public static Object[][] asyncInsertSettingsDP() {
269271
return new Object[][]{
270272
// asyncInsert, waitEndOfQuery, expectedUpdateCount, expectedSelectCount
271-
{ServerSettings.OFF, ServerSettings.OFF, 10000, 10000},
272-
{ServerSettings.OFF, ServerSettings.ON, 10000, 10000},
273+
{ServerSettings.OFF, ServerSettings.OFF, ASYNC_INSERT_SETTINGS_DP_ROWS, ASYNC_INSERT_SETTINGS_DP_ROWS},
274+
{ServerSettings.OFF, ServerSettings.ON, ASYNC_INSERT_SETTINGS_DP_ROWS, ASYNC_INSERT_SETTINGS_DP_ROWS},
273275
{ServerSettings.ON, ServerSettings.OFF, 0, -1},
274-
{ServerSettings.ON, ServerSettings.ON, 0, 10000}
276+
{ServerSettings.ON, ServerSettings.ON, 0, ASYNC_INSERT_SETTINGS_DP_ROWS}
275277
};
276278
}
277279

@@ -291,7 +293,7 @@ public void testInsertWithAsyncInsert(String asyncInsert, String waitAsyncInsert
291293
stmt.execute("TRUNCATE TABLE " + getDatabase() + "." + tableName);
292294

293295
StringBuilder sb = new StringBuilder("INSERT INTO " + getDatabase() + "." + tableName + " VALUES ");
294-
for (int i = 0; i < 10000; i++) {
296+
for (int i = 0; i < ASYNC_INSERT_SETTINGS_DP_ROWS; i++) {
295297
if (i > 0) sb.append(", ");
296298
sb.append("(").append(i).append(")");
297299
}
@@ -303,7 +305,7 @@ public void testInsertWithAsyncInsert(String asyncInsert, String waitAsyncInsert
303305
assertTrue(rs.next());
304306
int count = rs.getInt(1);
305307
if (expectedSelectCount == -1) {
306-
assertTrue(count < 10000, "Expected count to be < 10000, but was: " + count);
308+
assertTrue(count < ASYNC_INSERT_SETTINGS_DP_ROWS, "Expected count to be < " + ASYNC_INSERT_SETTINGS_DP_ROWS + ", but was: " + count);
307309
} else {
308310
assertEquals(count, expectedSelectCount);
309311
}

0 commit comments

Comments
 (0)