hawk9821 commented on code in PR #9749:
URL: https://github.com/apache/seatunnel/pull/9749#discussion_r2371922659
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/MysqlCDCWithBinlogDeleteIT.java:
##########
@@ -203,12 +203,15 @@ public void testRestoreTaskWhenBinlogDelete(TestContainer
container)
query(getSourceQuerySQL(MYSQL_DATABASE,
SOURCE_TABLE)),
query(getSinkQuerySQL(MYSQL_DATABASE,
SINK_TABLE)));
});
- // check no error
- log.info("****************** container logs start ******************");
- String containerLogs = container.getServerLogs();
- log.info(containerLogs);
- Assertions.assertFalse(containerLogs.contains("ERROR"));
- log.info("****************** container logs end ******************");
+ // check job status is not failed
+ await().pollDelay(20, TimeUnit.SECONDS)
+ .atMost(60, TimeUnit.SECONDS)
+ .untilAsserted(
+ () ->
+ Assertions.assertNotEquals(
+ "FAILED",
container.getJobStatus(String.valueOf(jobId))));
+ // cancel task
+ Assertions.assertEquals(0,
container.cancelJob(String.valueOf(jobId)).getExitCode());
Review Comment:
Detecting errors from logs is inefficient; directly checking if the task
status is `RUNNING` achieves the same result and offers higher execution
efficiency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]