diff --git a/TrafficCapture/build.gradle b/TrafficCapture/build.gradle index 58afc0aa0..2648d4506 100644 --- a/TrafficCapture/build.gradle +++ b/TrafficCapture/build.gradle @@ -48,6 +48,11 @@ allprojects { } task slowTest(type: Test) { + useJUnitPlatform { + // SlowTests currently use additional resource overhead, so halving core based parallelism + systemProperty 'junit.jupiter.execution.parallel.config.strategy', 'dynamic' + systemProperty 'junit.jupiter.execution.parallel.config.dynamic.factor', '0.5' + } systemProperty 'disableMemoryLeakTests', 'false' jacoco { enabled = true @@ -85,3 +90,4 @@ jacocoTestReport { html.destination file("${buildDir}/reports/jacoco/test/html") } } + diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/HttpdContainerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/HttpdContainerTest.java index 719069bae..9ff06a963 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/HttpdContainerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/HttpdContainerTest.java @@ -1,10 +1,16 @@ package org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.annotations; +import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import org.junit.jupiter.api.parallel.ResourceLock; @Inherited @ResourceLock("HttpdContainer") +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) @TestContainerTest public @interface HttpdContainerTest { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/KafkaContainerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/KafkaContainerTest.java index 30c5a2cd2..f283d63f8 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/KafkaContainerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/KafkaContainerTest.java @@ -1,10 +1,16 @@ package org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.annotations; +import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import org.junit.jupiter.api.parallel.ResourceLock; @Inherited @ResourceLock("KafkaContainer") +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) @TestContainerTest public @interface KafkaContainerTest { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/TestContainerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/TestContainerTest.java index 1163dff3e..18c9dedc4 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/TestContainerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/TestContainerTest.java @@ -1,10 +1,16 @@ package org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.annotations; +import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import org.junit.jupiter.api.Tag; import org.testcontainers.junit.jupiter.Testcontainers; @Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) @Tag("longTest") @Testcontainers(disabledWithoutDocker = true, parallel = true) public @interface TestContainerTest { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/ToxiproxyContainerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/ToxiproxyContainerTest.java index 85146b080..904252940 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/ToxiproxyContainerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/ToxiproxyContainerTest.java @@ -1,10 +1,16 @@ package org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.annotations; +import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import org.junit.jupiter.api.parallel.ResourceLock; @Inherited @ResourceLock("ToxiproxyContainerTestBase") +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) @TestContainerTest public @interface ToxiproxyContainerTest { }