From 6a5bd2d81e1010db1448618fa00928c3f0d14ca1 Mon Sep 17 00:00:00 2001 From: gongzhongqiang <764629910@qq.com> Date: Wed, 6 Apr 2022 16:48:14 +0800 Subject: [PATCH] [oceanbase] Remove useless dependency and code of test (#1046) --- flink-connector-oceanbase-cdc/pom.xml | 7 +------ .../cdc/connectors/oceanbase/OceanBaseTestBase.java | 11 ----------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/flink-connector-oceanbase-cdc/pom.xml b/flink-connector-oceanbase-cdc/pom.xml index 3f170f210..99cf4719a 100644 --- a/flink-connector-oceanbase-cdc/pom.xml +++ b/flink-connector-oceanbase-cdc/pom.xml @@ -138,12 +138,7 @@ under the License. ${testcontainers.version} test - - com.alibaba - dns-cache-manipulator - 1.7.1 - test - + diff --git a/flink-connector-oceanbase-cdc/src/test/java/com/ververica/cdc/connectors/oceanbase/OceanBaseTestBase.java b/flink-connector-oceanbase-cdc/src/test/java/com/ververica/cdc/connectors/oceanbase/OceanBaseTestBase.java index ef50aa686..597943a07 100644 --- a/flink-connector-oceanbase-cdc/src/test/java/com/ververica/cdc/connectors/oceanbase/OceanBaseTestBase.java +++ b/flink-connector-oceanbase-cdc/src/test/java/com/ververica/cdc/connectors/oceanbase/OceanBaseTestBase.java @@ -20,7 +20,6 @@ package com.ververica.cdc.connectors.oceanbase; import org.apache.flink.util.TestLogger; -import com.alibaba.dcm.DnsCacheManipulator; import org.awaitility.Awaitility; import org.awaitility.core.ConditionTimeoutException; import org.junit.AfterClass; @@ -29,7 +28,6 @@ import org.junit.ClassRule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.Network; import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.containers.wait.strategy.WaitAllStrategy; @@ -60,8 +58,6 @@ public class OceanBaseTestBase extends TestLogger { private static final Pattern COMMENT_PATTERN = Pattern.compile("^(.*)--.*$"); - public static final String OB_LOG_PROXY_SERVICE_NAME = "oblogproxy"; - // Should be deprecated after official images are released. public static final String DOCKER_IMAGE_NAME = "whhe/oblogproxy:obce_3.1.1"; @@ -75,13 +71,9 @@ public class OceanBaseTestBase extends TestLogger { public static final String OB_SYS_USERNAME = "root"; public static final String OB_SYS_PASSWORD = "pswd"; - @ClassRule public static final Network NETWORK = Network.newNetwork(); - @ClassRule public static final GenericContainer OB_WITH_LOG_PROXY = new GenericContainer<>(DOCKER_IMAGE_NAME) - .withNetwork(NETWORK) - .withNetworkAliases(OB_LOG_PROXY_SERVICE_NAME) .withExposedPorts(OB_SERVER_SQL_PORT, OB_SERVER_RPC_PORT, OB_LOG_PROXY_PORT) .withEnv("OB_ROOT_PASSWORD", OB_SYS_PASSWORD) .waitingFor( @@ -93,8 +85,6 @@ public class OceanBaseTestBase extends TestLogger { @BeforeClass public static void startContainers() { - // Add jvm dns cache for flink to invoke ob interface. - DnsCacheManipulator.setDnsCache(OB_LOG_PROXY_SERVICE_NAME, "127.0.0.1"); LOG.info("Starting containers..."); Startables.deepStart(Stream.of(OB_WITH_LOG_PROXY)).join(); LOG.info("Containers are started."); @@ -102,7 +92,6 @@ public class OceanBaseTestBase extends TestLogger { @AfterClass public static void stopContainers() { - DnsCacheManipulator.removeDnsCache(OB_LOG_PROXY_SERVICE_NAME); LOG.info("Stopping containers..."); Stream.of(OB_WITH_LOG_PROXY).forEach(GenericContainer::stop); LOG.info("Containers are stopped.");