diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index da6db221c..e2138789c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -19,6 +19,5 @@ jobs: with: java-version: '17' distribution: 'temurin' - - name: Run java client tests run: ./gradlew test -p java-client diff --git a/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/bulk/BulkIngesterRetryPolicyTest.java b/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/bulk/BulkIngesterRetryPolicyTest.java index dede24b9c..e4bbf88f8 100644 --- a/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/bulk/BulkIngesterRetryPolicyTest.java +++ b/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/bulk/BulkIngesterRetryPolicyTest.java @@ -38,12 +38,14 @@ import org.jetbrains.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIf; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Objects; +import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; @@ -287,6 +289,7 @@ public void retryTestNoFlushAndContextExponentialBackoff() throws Exception { } @Test + @DisabledIf("isGithubBuild") public void retryMultiThreadStressTest() throws InterruptedException, IOException { // DISCLAIMER: this configuration is highly inefficient and only used here to showcase an extreme @@ -541,4 +544,9 @@ private BulkIngester newBulkIngesterNoFlushAndContextAndLongExponential .backoffPolicy(BackoffPolicy.exponentialBackoff(100L, 8)) ); } + + private boolean isGithubBuild(){ + return Optional.ofNullable(System.getenv("GITHUB_JOB")) + .isPresent(); + } } diff --git a/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/bulk/BulkIngesterTest.java b/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/bulk/BulkIngesterTest.java index 76a48b9fa..08face1a2 100644 --- a/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/bulk/BulkIngesterTest.java +++ b/java-client/src/test/java/co/elastic/clients/elasticsearch/_helpers/bulk/BulkIngesterTest.java @@ -38,12 +38,14 @@ import org.jetbrains.annotations.Nullable; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIf; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; @@ -176,6 +178,7 @@ private void multiThreadTest(int maxOperations, int maxRequests, int numThreads, } @Test + @DisabledIf("isGithubBuild") public void multiThreadStressTest() throws InterruptedException, IOException { String index = "bulk-ingester-stress-test"; @@ -620,4 +623,8 @@ public void close() throws IOException { } } } + private boolean isGithubBuild(){ + return Optional.ofNullable(System.getenv("GITHUB_JOB")) + .isPresent(); + } }