Skip to content

Commit 8357c3d

Browse files
committed
Fix wakeup logic
1 parent 4464984 commit 8357c3d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

flink-connector-clickhouse-base/src/test/java/org/apache/flink/connector/test/embedded/clickhouse/ClickHouseServerForTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static void initConfiguration() {
4444
}
4545
isSSL = ClickHouseTestHelpers.isCloud();
4646
}
47-
public static void setUp() {
47+
public static void setUp() throws InterruptedException {
4848
if (database == null) {
4949
database = String.format("flink_connector_test_%s", System.currentTimeMillis());
5050
}
@@ -58,12 +58,13 @@ public static void setUp() {
5858
// have a for loop
5959
boolean isLive = false;
6060
int counter = 0;
61-
while (isLive || counter < 3) {
61+
while (counter < 5) {
6262
isLive = ClickHouseTestHelpers.ping(isCloud, host, port, isSSL, username, password);
63+
if (isLive) return;
64+
Thread.sleep(2000);
6365
counter++;
6466
}
65-
if (!isLive)
66-
throw new RuntimeException("Failed to connect to ClickHouse");
67+
throw new RuntimeException("Failed to connect to ClickHouse");
6768
}
6869
}
6970

0 commit comments

Comments
 (0)