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

kezhenxu94 pushed a commit to branch test/fix-kafka
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/test/fix-kafka by this push:
     new 0244c39  OK, the reason seems to be clear
0244c39 is described below

commit 0244c39af2648c70425f3c1cb117e1dc0439728a
Author: kezhenxu94 <[email protected]>
AuthorDate: Sat Jan 30 09:58:06 2021 +0800

    OK, the reason seems to be clear
---
 .../java/org/apache/skywalking/e2e/SkyWalkingAnnotations.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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);
             }
         }
 

Reply via email to