Skip to content

Commit 7692693

Browse files
committed
Reduce flakiness in io.opentelemetry.instrumentation.jmx.rules.WildflyTest.testWildflyMetrics(String)[2]
Automated fix attempt based on Develocity flaky-test analysis.
1 parent 83c1b4f commit 7692693

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules

instrumentation/jmx-metrics/library/src/test/java/io/opentelemetry/instrumentation/jmx/rules/WildflyTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
class WildflyTest extends TargetSystemTest {
2424

2525
private static final int WILDFLY_SERVICE_PORT = 8080;
26+
private static final String LEGACY_WILDFLY_IMAGE = "jboss/wildfly:10.1.0.Final";
2627

2728
@ParameterizedTest
2829
@ValueSource(
@@ -46,7 +47,10 @@ void testWildflyMetrics(String dockerImage) {
4647
.withStartupTimeout(Duration.ofMinutes(2))
4748
.withExposedPorts(WILDFLY_SERVICE_PORT)
4849
.withEnv("JAVA_TOOL_OPTIONS", String.join(" ", jvmArgs))
49-
.waitingFor(Wait.forListeningPorts(WILDFLY_SERVICE_PORT));
50+
.waitingFor(
51+
Wait.forHttp(testAppPath(dockerImage))
52+
.forPort(WILDFLY_SERVICE_PORT)
53+
.withStartupTimeout(Duration.ofMinutes(2)));
5054

5155
copyAgentToTarget(target);
5256
copyYamlFilesToTarget(target, yamlFiles);
@@ -207,4 +211,8 @@ dataSourceAttribute, attribute("db.client.connection.state", "idle"))))
207211
.hasUnit("{transaction}")
208212
.hasDataPointsWithoutAttributes());
209213
}
214+
215+
private static String testAppPath(String dockerImage) {
216+
return dockerImage.equals(LEGACY_WILDFLY_IMAGE) ? "/testapp/javax/" : "/testapp/jakarta/";
217+
}
210218
}

0 commit comments

Comments
 (0)