You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/02/22 02:11:07 UTC

[shardingsphere] branch master updated: Optimize agent e2e test (#24283)

This is an automated email from the ASF dual-hosted git repository.

zhonghongsheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new f1a442a65c2 Optimize agent e2e test (#24283)
f1a442a65c2 is described below

commit f1a442a65c22fcde0788cb85d6b96f3be3d70ba7
Author: jiangML <10...@qq.com>
AuthorDate: Wed Feb 22 10:10:47 2023 +0800

    Optimize agent e2e test (#24283)
    
    * optimize agent e2e test
    
    * optimize agent e2e test
---
 .../test/e2e/agent/common/env/E2ETestEnvironment.java    |  4 ++--
 test/e2e/agent/plugins/metrics/prometheus/pom.xml        | 16 ++--------------
 .../src/test/resources/env/engine-env.properties         |  2 +-
 3 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/test/e2e/agent/plugins/common/src/test/java/org/apache/shardingsphere/test/e2e/agent/common/env/E2ETestEnvironment.java b/test/e2e/agent/plugins/common/src/test/java/org/apache/shardingsphere/test/e2e/agent/common/env/E2ETestEnvironment.java
index 6e716a98736..94c1e8f2faf 100644
--- a/test/e2e/agent/plugins/common/src/test/java/org/apache/shardingsphere/test/e2e/agent/common/env/E2ETestEnvironment.java
+++ b/test/e2e/agent/plugins/common/src/test/java/org/apache/shardingsphere/test/e2e/agent/common/env/E2ETestEnvironment.java
@@ -63,7 +63,7 @@ public final class E2ETestEnvironment {
     /**
      * Create data source.
      */
-    public void createDataSource() {
+    public synchronized void createDataSource() {
         if (isEnvironmentPrepared && null == dataSource) {
             if (waitForEnvironmentReady(props)) {
                 dataSource = createHikariCP(props);
@@ -76,7 +76,7 @@ public final class E2ETestEnvironment {
     private boolean waitForEnvironmentReady(final Properties props) {
         log.info("Proxy with agent environment initializing ...");
         try {
-            Awaitility.await().atMost(4, TimeUnit.MINUTES).pollInterval(2, TimeUnit.SECONDS).until(() -> isProxyReady(props));
+            Awaitility.await().atMost(4, TimeUnit.MINUTES).pollInterval(5, TimeUnit.SECONDS).until(() -> isProxyReady(props));
         } catch (final ConditionTimeoutException ignored) {
             log.info("Proxy with agent environment initialization failed ...");
             return false;
diff --git a/test/e2e/agent/plugins/metrics/prometheus/pom.xml b/test/e2e/agent/plugins/metrics/prometheus/pom.xml
index e689e0c0245..16fe33451c4 100644
--- a/test/e2e/agent/plugins/metrics/prometheus/pom.xml
+++ b/test/e2e/agent/plugins/metrics/prometheus/pom.xml
@@ -29,6 +29,7 @@
     
     <properties>
         <maven.deploy.skip>true</maven.deploy.skip>
+        <mysql-connector-java.version>8.0.31</mysql-connector-java.version>
     </properties>
     
     <dependencies>
@@ -38,24 +39,11 @@
             <version>${project.version}</version>
             <type>test-jar</type>
         </dependency>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-jdbc-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-proxy-bootstrap</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-        </dependency>
         <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql-connector-java.version}</version>
             <scope>runtime</scope>
         </dependency>
         <dependency>
diff --git a/test/e2e/agent/plugins/metrics/prometheus/src/test/resources/env/engine-env.properties b/test/e2e/agent/plugins/metrics/prometheus/src/test/resources/env/engine-env.properties
index efb364216b2..ecbca1fc062 100644
--- a/test/e2e/agent/plugins/metrics/prometheus/src/test/resources/env/engine-env.properties
+++ b/test/e2e/agent/plugins/metrics/prometheus/src/test/resources/env/engine-env.properties
@@ -18,7 +18,7 @@
 it.env.type=${it.env}
 it.env.value=prometheus
 
-proxy.url=jdbc:mysql://127.0.0.1:43070/agent-metrics-db?serverTimezone=UTC&useSSL=false&useLocalSessionState=true&characterEncoding=utf-8&connectTimeout=3000
+proxy.url=jdbc:mysql://127.0.0.1:43070/agent-metrics-db?serverTimezone=UTC&useSSL=false&useLocalSessionState=true&characterEncoding=utf-8&connectTimeout=3000&socketTimeout=6000
 proxy.username=root
 proxy.password=root