From cb504132a49923825bfba01e4be5d46e23f578f0 Mon Sep 17 00:00:00 2001 From: robsunday Date: Tue, 17 Dec 2024 16:44:29 +0100 Subject: [PATCH 1/2] Improve containers startup and increase max duration of test --- .../target_systems/TargetSystemIntegrationTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/TargetSystemIntegrationTest.java b/jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/TargetSystemIntegrationTest.java index 5a94b69af..6ab7a175e 100644 --- a/jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/TargetSystemIntegrationTest.java +++ b/jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/TargetSystemIntegrationTest.java @@ -111,13 +111,13 @@ void endToEndTest(@TempDir Path tmpDir) { .withLogConsumer(new Slf4jLogConsumer(targetSystemLogger)) .withNetwork(network) .withNetworkAliases(TARGET_SYSTEM_NETWORK_ALIAS); - target.start(); scraper = new JmxScraperContainer(otlpEndpoint, scraperBaseImage()) .withLogConsumer(new Slf4jLogConsumer(jmxScraperLogger)) .withNetwork(network) - .withRmiServiceUrl(TARGET_SYSTEM_NETWORK_ALIAS, JMX_PORT); + .withRmiServiceUrl(TARGET_SYSTEM_NETWORK_ALIAS, JMX_PORT) + .dependsOn(target); scraper = customizeScraperContainer(scraper, target, tmpDir); scraper.start(); @@ -167,7 +167,7 @@ protected final void waitAndAssertMetrics(Consumer... assertions) { protected void verifyMetrics() { MetricsVerifier metricsVerifier = createMetricsVerifier(); await() - .atMost(Duration.ofSeconds(30)) + .atMost(Duration.ofSeconds(60)) .untilAsserted( () -> { List receivedMetrics = otlpServer.getMetrics(); From a9b3cb64ebfab26e49f43f1306c8922a6460c0e3 Mon Sep 17 00:00:00 2001 From: robsunday Date: Tue, 17 Dec 2024 17:50:13 +0100 Subject: [PATCH 2/2] Removed using dependsOn for target/scraper container configuration --- .../target_systems/TargetSystemIntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/TargetSystemIntegrationTest.java b/jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/TargetSystemIntegrationTest.java index 6ab7a175e..3623a0146 100644 --- a/jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/TargetSystemIntegrationTest.java +++ b/jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/TargetSystemIntegrationTest.java @@ -111,13 +111,13 @@ void endToEndTest(@TempDir Path tmpDir) { .withLogConsumer(new Slf4jLogConsumer(targetSystemLogger)) .withNetwork(network) .withNetworkAliases(TARGET_SYSTEM_NETWORK_ALIAS); + target.start(); scraper = new JmxScraperContainer(otlpEndpoint, scraperBaseImage()) .withLogConsumer(new Slf4jLogConsumer(jmxScraperLogger)) .withNetwork(network) - .withRmiServiceUrl(TARGET_SYSTEM_NETWORK_ALIAS, JMX_PORT) - .dependsOn(target); + .withRmiServiceUrl(TARGET_SYSTEM_NETWORK_ALIAS, JMX_PORT); scraper = customizeScraperContainer(scraper, target, tmpDir); scraper.start();