JiriOndrusek commented on code in PR #8877:
URL: https://github.com/apache/camel-quarkus/pull/8877#discussion_r3585021753
##########
integration-tests-support/splunk/src/test/java/org/apache/camel/quarkus/test/support/splunk/SplunkTestResource.java:
##########
@@ -125,6 +129,20 @@ public Map<String, String> start() {
.collect(Collectors.joining("\n")));
LOG.debug(banner);
+ // In Quarkus native, test can fail with
`java.net.SocketException: Network is unreachable` if underlying network isn't
ready yet
+ LOG.info("Waiting for Splunk network bridge ({}:{}) to be fully
ready...", splunkHost, hecPort);
+
+ Awaitility.await()
+ .atMost(Duration.ofSeconds(60))
+ .pollInterval(Duration.ofMillis(500))
+ .ignoreExceptions()
+ .until(() -> {
+ LOG.info("Trying to connect to Splunk HEC via
socket.");
Review Comment:
The log might be repeated many, many times. I'd to move it before awaitility
block
##########
integration-tests-support/splunk/src/test/java/org/apache/camel/quarkus/test/support/splunk/SplunkTestResource.java:
##########
@@ -36,6 +38,7 @@
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.images.builder.Transferable;
+import org.testcontainers.shaded.org.awaitility.Awaitility;
Review Comment:
org.awaitility.Awaitility should be used
##########
integration-tests-support/splunk/src/test/java/org/apache/camel/quarkus/test/support/splunk/SplunkTestResource.java:
##########
@@ -125,6 +129,20 @@ public Map<String, String> start() {
.collect(Collectors.joining("\n")));
LOG.debug(banner);
+ // In Quarkus native, test can fail with
`java.net.SocketException: Network is unreachable` if underlying network isn't
ready yet
+ LOG.info("Waiting for Splunk network bridge ({}:{}) to be fully
ready...", splunkHost, hecPort);
+
+ Awaitility.await()
+ .atMost(Duration.ofSeconds(60))
+ .pollInterval(Duration.ofMillis(500))
+ .ignoreExceptions()
+ .until(() -> {
+ LOG.info("Trying to connect to Splunk HEC via
socket.");
+ try (Socket socket = new Socket(splunkHost, hecPort)) {
Review Comment:
Perhaps it could be possible to use some kind of wait strategy (e.g.
https://github.com/apache/camel-quarkus/blob/9bcfb7f02d3b7ad1e4573141572c041a012b931a/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTestResource.java#L51)
##########
integration-tests/quartz-clustered/src/test/java/org/apache/camel/quarkus/component/quartz/it/QuartzClusteredTest.java:
##########
@@ -101,7 +101,11 @@ public void clustering() throws IOException {
}
private void awaitStartup(QuarkusProcessExecutor quarkusProcessExecutor) {
- Awaitility.await().atMost(60, TimeUnit.SECONDS).pollDelay(1,
TimeUnit.SECONDS).until(() -> {
+ long timeout = ConfigProvider.getConfig()
+
.getOptionalValue("quartz.clustered.test.startup.timeout.seconds", Long.class)
Review Comment:
wouldn't be better to have this property in the application.properties with
some default value (60)? (it could be easier recognizable then default in code
here)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]