Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

Commit b29ef8a

Browse files
[Improve][Connecotr-v2][Databend] Optimize CI judgment logic (apache#10130)
1 parent b982600 commit b29ef8a

File tree

1 file changed

+20
-20
lines changed
  • seatunnel-e2e/seatunnel-connector-v2-e2e/connector-databend-e2e/src/test/java/org/apache/seatunnel/e2e/connector/databend

1 file changed

+20
-20
lines changed

seatunnel-e2e/seatunnel-connector-v2-e2e/connector-databend-e2e/src/test/java/org/apache/seatunnel/e2e/connector/databend/DatabendCDCSinkIT.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,26 @@ public void testDatabendSinkCDC(TestContainer container) throws Exception {
7575
container.executeJob("/databend/fake_to_databend_cdc.conf");
7676
Assertions.assertEquals(0, execResult.getExitCode(), execResult.getStderr());
7777

78-
// Wait for the merge operation to complete
79-
// Increased wait time to ensure merge operations finish
80-
Thread.sleep(10000);
78+
Awaitility.await()
79+
.atMost(120, TimeUnit.SECONDS)
80+
.pollInterval(1, TimeUnit.SECONDS)
81+
.ignoreExceptions()
82+
.untilAsserted(
83+
() -> {
84+
try (Statement stmt = connection.createStatement();
85+
ResultSet rs =
86+
stmt.executeQuery(
87+
"SELECT COUNT(*) as count FROM sink_table")) {
88+
if (rs.next()) {
89+
int count = rs.getInt("count");
90+
LOG.info(
91+
"Current record count in sink_table: {}, expecting 3",
92+
count);
93+
Assertions.assertEquals(
94+
3, count, "Expected 3 records in sink_table");
95+
}
96+
}
97+
});
8198

8299
// Verify the sink results
83100
try (Statement statement = connection.createStatement()) {
@@ -270,23 +287,6 @@ private boolean createMinIOBucketWithAWSSDK(String bucketName) {
270287
}
271288
}
272289

273-
// private synchronized Connection getConnection() throws SQLException {
274-
// if (this.connection == null || this.connection.isClosed()) {
275-
// LOG.info("Creating new database connection");
276-
// final Properties info = new Properties();
277-
// info.put("user", "root");
278-
// info.put("password", "");
279-
//
280-
// String jdbcUrl =
281-
// String.format(
282-
// "jdbc:databend://%s:%d/%s?ssl=false",
283-
// container.getHost(), container.getMappedPort(8000), DATABASE);
284-
//
285-
// this.connection = DriverManager.getConnection(jdbcUrl, info);
286-
// }
287-
// return this.connection;
288-
// }
289-
290290
private void initConnection()
291291
throws SQLException, ClassNotFoundException, InstantiationException,
292292
IllegalAccessException {

0 commit comments

Comments
 (0)