From 0a4065fe95fe82295732ea2f1855e689a7427276 Mon Sep 17 00:00:00 2001 From: gnehil Date: Mon, 30 Oct 2023 16:20:19 +0800 Subject: [PATCH] add be alive check --- .../seatunnel/e2e/connector/doris/DorisCatalogIT.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-doris-e2e/src/test/java/org/apache/seatunnel/e2e/connector/doris/DorisCatalogIT.java b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-doris-e2e/src/test/java/org/apache/seatunnel/e2e/connector/doris/DorisCatalogIT.java index 648d4b4e20f9..a834758f1b96 100644 --- a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-doris-e2e/src/test/java/org/apache/seatunnel/e2e/connector/doris/DorisCatalogIT.java +++ b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-doris-e2e/src/test/java/org/apache/seatunnel/e2e/connector/doris/DorisCatalogIT.java @@ -49,6 +49,7 @@ import java.net.URLClassLoader; import java.sql.Connection; import java.sql.Driver; +import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Arrays; @@ -81,6 +82,7 @@ public class DorisCatalogIT extends TestSuiteBase implements TestResource { "https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar"; private static final String SET_SQL = "ADMIN SET FRONTEND CONFIG (\"enable_batch_delete_by_default\" = \"true\")"; + private static final String SHOW_BE = "SHOW BACKENDS"; private GenericContainer container; private Connection jdbcConnection; @@ -99,6 +101,7 @@ public void startUp() throws Exception { .withEnv("FE_ID", "1") .withEnv("CURRENT_BE_IP", "127.0.0.1") .withEnv("CURRENT_BE_PORT", "9050") + .withCommand("ulimit -n 65536") .withPrivilegedMode(true) .withLogConsumer( new Slf4jLogConsumer(DockerLoggerFactory.getLogger(DOCKER_IMAGE))); @@ -227,6 +230,13 @@ private void initializeJdbcConnection() jdbcConnection = driver.connect(String.format(URL, container.getHost()), props); try (Statement statement = jdbcConnection.createStatement()) { statement.execute(SET_SQL); + ResultSet resultSet; + + do { + resultSet = statement.executeQuery(SHOW_BE); + } while (!resultSet.next() + || (!"Yes".equalsIgnoreCase(resultSet.getString(9)) + && !"Yes".equalsIgnoreCase(resultSet.getString(10)))); } } }