From 6ec371659400f953c32189dd29d194f97d90a56d Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Wed, 30 Jun 2021 17:56:08 +0200 Subject: [PATCH] [7.x] Skip Google Cloud Storage tests on JDK (#74763) See #53119 for more context about why those tests are muted on JDK8. They start failing more often recently now #74313 and #74620 have been merged, as reported in #74739. --- .../gcs/GoogleCloudStorageThirdPartyTests.java | 6 ++++++ .../metering/gcs/GCSRepositoriesMeteringIT.java | 10 ++++++++++ .../searchablesnapshots/GCSSearchableSnapshotsIT.java | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java b/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java index fdb4f4b447ce4..9e86ccc012312 100644 --- a/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java +++ b/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageThirdPartyTests.java @@ -15,6 +15,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.repositories.AbstractThirdPartyRepositoryTestCase; +import org.junit.BeforeClass; import java.util.Base64; import java.util.Collection; @@ -25,6 +26,11 @@ public class GoogleCloudStorageThirdPartyTests extends AbstractThirdPartyRepositoryTestCase { + @BeforeClass + public static void skipJava8() { + GoogleCloudStorageBlobStoreRepositoryTests.assumeNotJava8(); + } + @Override protected Collection> getPlugins() { return pluginList(GoogleCloudStoragePlugin.class); diff --git a/x-pack/plugin/repositories-metering-api/qa/gcs/src/test/java/org/elasticsearch/xpack/repositories/metering/gcs/GCSRepositoriesMeteringIT.java b/x-pack/plugin/repositories-metering-api/qa/gcs/src/test/java/org/elasticsearch/xpack/repositories/metering/gcs/GCSRepositoriesMeteringIT.java index 888cc9e2f2a8d..eab7d4e0c82ec 100644 --- a/x-pack/plugin/repositories-metering-api/qa/gcs/src/test/java/org/elasticsearch/xpack/repositories/metering/gcs/GCSRepositoriesMeteringIT.java +++ b/x-pack/plugin/repositories-metering-api/qa/gcs/src/test/java/org/elasticsearch/xpack/repositories/metering/gcs/GCSRepositoriesMeteringIT.java @@ -7,13 +7,23 @@ package org.elasticsearch.xpack.repositories.metering.gcs; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.jdk.JavaVersion; import org.elasticsearch.xpack.repositories.metering.AbstractRepositoriesMeteringAPIRestTestCase; +import org.junit.BeforeClass; import java.util.List; import java.util.Map; public class GCSRepositoriesMeteringIT extends AbstractRepositoriesMeteringAPIRestTestCase { + @BeforeClass + public static void skipJava8() { + assumeFalse("This test is flaky on jdk8 - we suspect a JDK bug to trigger some assertion in the HttpServer implementation used " + + "to emulate the server side logic of Google Cloud Storage. See https://bugs.openjdk.java.net/browse/JDK-8180754, " + + "https://github.com/elastic/elasticsearch/pull/51933 and https://github.com/elastic/elasticsearch/issues/52906 " + + "for more background on this issue.", JavaVersion.current().equals(JavaVersion.parse("8"))); + } + @Override protected String repositoryType() { return "gcs"; diff --git a/x-pack/plugin/searchable-snapshots/qa/gcs/src/test/java/org/elasticsearch/xpack/searchablesnapshots/GCSSearchableSnapshotsIT.java b/x-pack/plugin/searchable-snapshots/qa/gcs/src/test/java/org/elasticsearch/xpack/searchablesnapshots/GCSSearchableSnapshotsIT.java index 1c60c400a45ab..df1f610bc9ba2 100644 --- a/x-pack/plugin/searchable-snapshots/qa/gcs/src/test/java/org/elasticsearch/xpack/searchablesnapshots/GCSSearchableSnapshotsIT.java +++ b/x-pack/plugin/searchable-snapshots/qa/gcs/src/test/java/org/elasticsearch/xpack/searchablesnapshots/GCSSearchableSnapshotsIT.java @@ -8,12 +8,22 @@ package org.elasticsearch.xpack.searchablesnapshots; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.jdk.JavaVersion; +import org.junit.BeforeClass; import static org.hamcrest.Matchers.blankOrNullString; import static org.hamcrest.Matchers.not; public class GCSSearchableSnapshotsIT extends AbstractSearchableSnapshotsRestTestCase { + @BeforeClass + public static void skipJava8() { + assumeFalse("This test is flaky on jdk8 - we suspect a JDK bug to trigger some assertion in the HttpServer implementation used " + + "to emulate the server side logic of Google Cloud Storage. See https://bugs.openjdk.java.net/browse/JDK-8180754, " + + "https://github.com/elastic/elasticsearch/pull/51933 and https://github.com/elastic/elasticsearch/issues/52906 " + + "for more background on this issue.", JavaVersion.current().equals(JavaVersion.parse("8"))); + } + @Override protected String writeRepositoryType() { return "gcs";