Skip to content

Commit 4d1989a

Browse files
committed
use generic JVM params + faster cassandra startup
1 parent 5df0512 commit 4d1989a

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/ActiveMqIntegrationTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ protected GenericContainer<?> createTargetContainer(int jmxPort) {
2525
builder -> builder.from("apache/activemq-classic:5.18.6").build()))
2626
.withEnv(
2727
"JAVA_TOOL_OPTIONS",
28-
"-Dcom.sun.management.jmxremote.port="
29-
+ jmxPort
30-
+ " -Dcom.sun.management.jmxremote.rmi.port="
31-
+ jmxPort
32-
+ " -Dcom.sun.management.jmxremote.ssl=false"
33-
+ " -Dcom.sun.management.jmxremote.authenticate=false")
28+
genericJmxJvmArguments(jmxPort))
3429
.withStartupTimeout(Duration.ofMinutes(2))
3530
.waitingFor(Wait.forListeningPort());
3631
}

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/CassandraIntegrationTest.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,16 @@
1818
import org.assertj.core.api.MapAssert;
1919
import org.testcontainers.containers.GenericContainer;
2020
import org.testcontainers.containers.wait.strategy.Wait;
21-
import org.testcontainers.images.builder.ImageFromDockerfile;
2221

2322
public class CassandraIntegrationTest extends TargetSystemIntegrationTest {
2423

2524
@Override
2625
protected GenericContainer<?> createTargetContainer(int jmxPort) {
27-
return new GenericContainer<>(
28-
new ImageFromDockerfile()
29-
.withDockerfileFromBuilder(builder -> builder.from("cassandra:5.0.2").build()))
30-
.withEnv(
31-
"JVM_EXTRA_OPTS",
32-
" -Dcassandra.jmx.remote.port="
33-
+ jmxPort
34-
+ " -Dcom.sun.management.jmxremote.rmi.port="
35-
+ jmxPort
36-
+ " -Dcom.sun.management.jmxremote.local.only=false"
37-
+ " -Dcom.sun.management.jmxremote.ssl=false"
38-
+ " -Dcom.sun.management.jmxremote.authenticate=false")
26+
return new GenericContainer<>("cassandra:5.0.2")
27+
.withEnv("JVM_EXTRA_OPTS",
28+
genericJmxJvmArguments(jmxPort)
29+
// making cassandra startup faster for single node, from ~1min to ~15s
30+
+ " -Dcassandra.skip_wait_for_gossip_to_settle=0 -Dcassandra.initial_token=0")
3931
.withStartupTimeout(Duration.ofMinutes(2))
4032
.waitingFor(Wait.forLogMessage(".*Startup complete.*", 1));
4133
}

0 commit comments

Comments
 (0)