[oceanbase] Remove useless dependency and code of test (#1046)

pull/1090/head
gongzhongqiang 3 years ago committed by GitHub
parent 2982bc0b71
commit 6a5bd2d81e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -138,12 +138,7 @@ under the License.
<version>${testcontainers.version}</version> <version>${testcontainers.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dns-cache-manipulator</artifactId>
<version>1.7.1</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -20,7 +20,6 @@ package com.ververica.cdc.connectors.oceanbase;
import org.apache.flink.util.TestLogger; import org.apache.flink.util.TestLogger;
import com.alibaba.dcm.DnsCacheManipulator;
import org.awaitility.Awaitility; import org.awaitility.Awaitility;
import org.awaitility.core.ConditionTimeoutException; import org.awaitility.core.ConditionTimeoutException;
import org.junit.AfterClass; import org.junit.AfterClass;
@ -29,7 +28,6 @@ import org.junit.ClassRule;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.containers.wait.strategy.WaitAllStrategy; import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
@ -60,8 +58,6 @@ public class OceanBaseTestBase extends TestLogger {
private static final Pattern COMMENT_PATTERN = Pattern.compile("^(.*)--.*$"); 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. // Should be deprecated after official images are released.
public static final String DOCKER_IMAGE_NAME = "whhe/oblogproxy:obce_3.1.1"; 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_USERNAME = "root";
public static final String OB_SYS_PASSWORD = "pswd"; public static final String OB_SYS_PASSWORD = "pswd";
@ClassRule public static final Network NETWORK = Network.newNetwork();
@ClassRule @ClassRule
public static final GenericContainer<?> OB_WITH_LOG_PROXY = public static final GenericContainer<?> OB_WITH_LOG_PROXY =
new GenericContainer<>(DOCKER_IMAGE_NAME) 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) .withExposedPorts(OB_SERVER_SQL_PORT, OB_SERVER_RPC_PORT, OB_LOG_PROXY_PORT)
.withEnv("OB_ROOT_PASSWORD", OB_SYS_PASSWORD) .withEnv("OB_ROOT_PASSWORD", OB_SYS_PASSWORD)
.waitingFor( .waitingFor(
@ -93,8 +85,6 @@ public class OceanBaseTestBase extends TestLogger {
@BeforeClass @BeforeClass
public static void startContainers() { 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..."); LOG.info("Starting containers...");
Startables.deepStart(Stream.of(OB_WITH_LOG_PROXY)).join(); Startables.deepStart(Stream.of(OB_WITH_LOG_PROXY)).join();
LOG.info("Containers are started."); LOG.info("Containers are started.");
@ -102,7 +92,6 @@ public class OceanBaseTestBase extends TestLogger {
@AfterClass @AfterClass
public static void stopContainers() { public static void stopContainers() {
DnsCacheManipulator.removeDnsCache(OB_LOG_PROXY_SERVICE_NAME);
LOG.info("Stopping containers..."); LOG.info("Stopping containers...");
Stream.of(OB_WITH_LOG_PROXY).forEach(GenericContainer::stop); Stream.of(OB_WITH_LOG_PROXY).forEach(GenericContainer::stop);
LOG.info("Containers are stopped."); LOG.info("Containers are stopped.");

Loading…
Cancel
Save