diff --git a/flink-doris-connector/src/test/java/org/apache/doris/flink/DorisTestBase.java b/flink-doris-connector/src/test/java/org/apache/doris/flink/DorisTestBase.java index 09ae4bddb..e05c0fdc3 100644 --- a/flink-doris-connector/src/test/java/org/apache/doris/flink/DorisTestBase.java +++ b/flink-doris-connector/src/test/java/org/apache/doris/flink/DorisTestBase.java @@ -72,7 +72,10 @@ protected static String getFenodes() { return DORIS_CONTAINER.getHost() + ":8030"; } - @BeforeClass + static { + startContainers(); + } + public static void startContainers() { LOG.info("Starting doris containers..."); Startables.deepStart(Stream.of(DORIS_CONTAINER)).join(); @@ -84,7 +87,6 @@ public static void startContainers() { LOG.info("Containers doris are started."); } - @AfterClass public static void stopContainers() { LOG.info("Stopping doris containers..."); DORIS_CONTAINER.stop(); @@ -92,6 +94,7 @@ public static void stopContainers() { } public static GenericContainer createDorisContainer() { + LOG.info("Create doris containers..."); GenericContainer container = new GenericContainer<>(DORIS_DOCKER_IMAGE) .withNetwork(Network.newNetwork()) @@ -99,8 +102,7 @@ public static GenericContainer createDorisContainer() { .withPrivilegedMode(true) .withLogConsumer( new Slf4jLogConsumer( - DockerLoggerFactory.getLogger(DORIS_DOCKER_IMAGE))) - .withReuse(true); + DockerLoggerFactory.getLogger(DORIS_DOCKER_IMAGE))); container.setPortBindings( Lists.newArrayList(