diff --git a/instrumentation/cassandra/cassandra-3.0/javaagent/src/test/groovy/CassandraClientTest.groovy b/instrumentation/cassandra/cassandra-3.0/javaagent/src/test/groovy/CassandraClientTest.groovy index a2066dfb942c..2d7111cd2a2a 100644 --- a/instrumentation/cassandra/cassandra-3.0/javaagent/src/test/groovy/CassandraClientTest.groovy +++ b/instrumentation/cassandra/cassandra-3.0/javaagent/src/test/groovy/CassandraClientTest.groovy @@ -37,6 +37,8 @@ class CassandraClientTest extends AgentInstrumentationSpecification { def setupSpec() { cassandra = new GenericContainer("cassandra:3") + // limit memory usage + .withEnv("JVM_OPTS", "-Xmx128m -Xms128m") .withExposedPorts(9042) .withLogConsumer(new Slf4jLogConsumer(logger)) .withStartupTimeout(Duration.ofSeconds(120)) diff --git a/instrumentation/cassandra/cassandra-4.0/javaagent/src/test/groovy/CassandraClientTest.groovy b/instrumentation/cassandra/cassandra-4.0/javaagent/src/test/groovy/CassandraClientTest.groovy index f216def00813..3711bfd09149 100644 --- a/instrumentation/cassandra/cassandra-4.0/javaagent/src/test/groovy/CassandraClientTest.groovy +++ b/instrumentation/cassandra/cassandra-4.0/javaagent/src/test/groovy/CassandraClientTest.groovy @@ -32,6 +32,8 @@ class CassandraClientTest extends AgentInstrumentationSpecification { def setupSpec() { cassandra = new GenericContainer("cassandra:4.0") + // limit memory usage + .withEnv("JVM_OPTS", "-Xmx128m -Xms128m") .withExposedPorts(9042) .withLogConsumer(new Slf4jLogConsumer(logger)) .withStartupTimeout(Duration.ofSeconds(120))