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

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


The following commit(s) were added to refs/heads/master by this push:
     new 56c264d  test: fix flaky E2E test of Kafka (#6281)
56c264d is described below

commit 56c264d1fa640115197ed19bb8a68388c6fa3b95
Author: Zhenxu Ke <[email protected]>
AuthorDate: Sat Jan 30 11:46:05 2021 +0800

    test: fix flaky E2E test of Kafka (#6281)
---
 .github/workflows/e2e.kafka.yaml                                 | 4 ++--
 CHANGES.md                                                       | 1 +
 .../java/org/apache/skywalking/e2e/SkyWalkingAnnotations.java    | 9 ++++++---
 test/e2e/pom.xml                                                 | 2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/e2e.kafka.yaml b/.github/workflows/e2e.kafka.yaml
index 7a79535..0cf63b6 100644
--- a/.github/workflows/e2e.kafka.yaml
+++ b/.github/workflows/e2e.kafka.yaml
@@ -30,13 +30,13 @@ env:
 
 jobs:
   Kafka:
-    name: ${{ matrix.case.name }}
+    name: Kafka (${{ matrix.case.name }})
     runs-on: ubuntu-latest
     timeout-minutes: 90
     strategy:
       matrix:
         case:
-          - name: Kafka
+          - name: Base
             class: org.apache.skywalking.e2e.kafka.KafkaE2E
           - name: Profiling
             class: org.apache.skywalking.e2e.kafka.KafkaProfileE2E
diff --git a/CHANGES.md b/CHANGES.md
index 46dc3a0..1696a4e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -11,6 +11,7 @@ Release Notes.
 * Add ElasticSearch 7.10 to test matrix and verify it works.
 * Replace Apache RAT with skywalking-eyes to check license headers.
 * Set up test of Envoy ALS / MetricsService under Istio 1.8.2 to verify Envoy 
V3 protocol
+* Test: fix flaky E2E test of Kafka.
 
 #### Java Agent
 * The operation name of quartz-scheduler plugin, has been changed as the 
`quartz-scheduler/${className}` format.
diff --git 
a/test/e2e/e2e-common/src/main/java/org/apache/skywalking/e2e/SkyWalkingAnnotations.java
 
b/test/e2e/e2e-common/src/main/java/org/apache/skywalking/e2e/SkyWalkingAnnotations.java
index 96817d8..e6ef236 100644
--- 
a/test/e2e/e2e-common/src/main/java/org/apache/skywalking/e2e/SkyWalkingAnnotations.java
+++ 
b/test/e2e/e2e-common/src/main/java/org/apache/skywalking/e2e/SkyWalkingAnnotations.java
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.lang.reflect.Field;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.time.Duration;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Objects;
@@ -47,6 +48,7 @@ import org.testcontainers.containers.ContainerState;
 import org.testcontainers.containers.DockerComposeContainer;
 import org.testcontainers.containers.output.Slf4jLogConsumer;
 import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.containers.wait.strategy.WaitStrategy;
 
 import static java.util.stream.Collectors.joining;
 import static org.apache.skywalking.e2e.utils.Yamls.load;
@@ -226,17 +228,18 @@ public final class SkyWalkingAnnotations {
                     "field cannot be annotated with both ContainerHost and 
ContainerPort: " + field.getName()
                 );
             }
+            final WaitStrategy waitStrategy = 
Wait.forListeningPort().withStartupTimeout(Duration.ofMinutes(5));
             if (field.isAnnotationPresent(ContainerHost.class)) {
                 final ContainerHost host = 
field.getAnnotation(ContainerHost.class);
-                compose.withExposedService(host.name(), host.port(), 
Wait.forListeningPort());
+                compose.withExposedService(host.name(), host.port(), 
waitStrategy);
             }
             if (field.isAnnotationPresent(ContainerPort.class)) {
                 final ContainerPort port = 
field.getAnnotation(ContainerPort.class);
-                compose.withExposedService(port.name(), port.port(), 
Wait.forListeningPort());
+                compose.withExposedService(port.name(), port.port(), 
waitStrategy);
             }
             if (field.isAnnotationPresent(ContainerHostAndPort.class)) {
                 final ContainerHostAndPort hostAndPort = 
field.getAnnotation(ContainerHostAndPort.class);
-                compose.withExposedService(hostAndPort.name(), 
hostAndPort.port(), Wait.forListeningPort());
+                compose.withExposedService(hostAndPort.name(), 
hostAndPort.port(), waitStrategy);
             }
         }
 
diff --git a/test/e2e/pom.xml b/test/e2e/pom.xml
index 1e52885..2e3ee23 100644
--- a/test/e2e/pom.xml
+++ b/test/e2e/pom.xml
@@ -64,7 +64,7 @@
         <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
         
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
 
-        <testcontainers.version>1.15.0</testcontainers.version>
+        <testcontainers.version>1.15.1</testcontainers.version>
     </properties>
 
     <repositories>

Reply via email to