Skip to content

Commit d2bcec0

Browse files
committed
Mute GoogleCloudStorageBlobStoreRepositoryTests on jdk8 (#53119)
Tests in GoogleCloudStorageBlobStoreRepositoryTests are known to be flaky on JDK 8 (#51446, #52430 ) and we suspect a JDK bug (https://bugs.openjdk.java.net/browse/JDK-8180754) that triggers some assertion on the server side logic that emulates the Google Cloud Storage service. Sadly we were not able to reproduce the failures, even when using the same OS (Debian 9, Ubuntu 16.04) and JDK (Oracle Corporation 1.8.0_241 [Java HotSpot(TM) 64-Bit Server VM 25.241-b07]) of almost all the test failures on CI. While we spent some time fixing code (#51933, #52431) to circumvent the JDK bug they are still flaky on JDK-8. This commit mute these tests for JDK-8 only. Close ##52906
1 parent 2878ec8 commit d2bcec0

File tree

2 files changed

+65
-3
lines changed

2 files changed

+65
-3
lines changed

plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java

+64-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
import fixture.gcs.GoogleCloudStorageHttpHandler;
2929
import org.apache.lucene.util.BytesRef;
3030
import org.apache.lucene.util.BytesRefBuilder;
31-
import org.apache.lucene.util.LuceneTestCase;
3231
import org.elasticsearch.action.ActionRunnable;
3332
import org.elasticsearch.action.support.PlainActionFuture;
33+
import org.elasticsearch.bootstrap.JavaVersion;
3434
import org.elasticsearch.cluster.metadata.RepositoryMetaData;
3535
import org.elasticsearch.cluster.service.ClusterService;
3636
import org.elasticsearch.common.SuppressForbidden;
@@ -67,9 +67,15 @@
6767
import static org.elasticsearch.repositories.gcs.GoogleCloudStorageRepository.CLIENT_NAME;
6868

6969
@SuppressForbidden(reason = "this test uses a HttpServer to emulate a Google Cloud Storage endpoint")
70-
@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/52906")
7170
public class GoogleCloudStorageBlobStoreRepositoryTests extends ESMockAPIBasedRepositoryIntegTestCase {
7271

72+
private static void assumeNotJava8() {
73+
assumeFalse("This test is flaky on jdk8 - we suspect a JDK bug to trigger some assertion in the HttpServer implementation used " +
74+
"to emulate the server side logic of Google Cloud Storage. See https://bugs.openjdk.java.net/browse/JDK-8180754, " +
75+
"https://github.com/elastic/elasticsearch/pull/51933 and https://github.com/elastic/elasticsearch/issues/52906 " +
76+
"for more background on this issue.", JavaVersion.current().equals(JavaVersion.parse("8")));
77+
}
78+
7379
@Override
7480
protected String repositoryType() {
7581
return GoogleCloudStorageRepository.TYPE;
@@ -117,6 +123,7 @@ protected Settings nodeSettings(int nodeOrdinal) {
117123
}
118124

119125
public void testDeleteSingleItem() {
126+
assumeNotJava8();
120127
final String repoName = createRepository(randomName());
121128
final RepositoriesService repositoriesService = internalCluster().getMasterNodeInstance(RepositoriesService.class);
122129
final BlobStoreRepository repository = (BlobStoreRepository) repositoriesService.repository(repoName);
@@ -163,7 +170,62 @@ public void testChunkSize() {
163170
assertEquals("failed to parse value [101mb] for setting [chunk_size], must be <= [100mb]", e.getMessage());
164171
}
165172

173+
@Override
174+
public void testSnapshotAndRestore() throws Exception {
175+
assumeNotJava8();
176+
super.testSnapshotAndRestore();
177+
}
178+
179+
@Override
180+
public void testList() throws IOException {
181+
assumeNotJava8();
182+
super.testList();
183+
}
184+
185+
@Override
186+
public void testIndicesDeletedFromRepository() throws Exception {
187+
assumeNotJava8();
188+
super.testIndicesDeletedFromRepository();
189+
}
190+
191+
@Override
192+
public void testDeleteBlobs() throws IOException {
193+
assumeNotJava8();
194+
super.testDeleteBlobs();
195+
}
196+
197+
@Override
198+
public void testWriteRead() throws IOException {
199+
assumeNotJava8();
200+
super.testWriteRead();
201+
}
202+
203+
@Override
204+
public void testReadNonExistingPath() throws IOException {
205+
assumeNotJava8();
206+
super.testReadNonExistingPath();
207+
}
208+
209+
@Override
210+
public void testContainerCreationAndDeletion() throws IOException {
211+
assumeNotJava8();
212+
super.testContainerCreationAndDeletion();
213+
}
214+
215+
@Override
216+
public void testMultipleSnapshotAndRollback() throws Exception {
217+
assumeNotJava8();
218+
super.testMultipleSnapshotAndRollback();
219+
}
220+
221+
@Override
222+
public void testSnapshotWithLargeSegmentFiles() throws Exception {
223+
assumeNotJava8();
224+
super.testSnapshotWithLargeSegmentFiles();
225+
}
226+
166227
public void testWriteReadLarge() throws IOException {
228+
assumeNotJava8();
167229
try (BlobStore store = newBlobStore()) {
168230
final BlobContainer container = store.blobContainer(new BlobPath());
169231
byte[] data = randomBytes(GoogleCloudStorageBlobStore.LARGE_BLOB_THRESHOLD_BYTE_SIZE + 1);

test/framework/src/main/java/org/elasticsearch/repositories/blobstore/ESMockAPIBasedRepositoryIntegTestCase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void tearDownHttpServer() {
122122
/**
123123
* Test the snapshot and restore of an index which has large segments files.
124124
*/
125-
public final void testSnapshotWithLargeSegmentFiles() throws Exception {
125+
public void testSnapshotWithLargeSegmentFiles() throws Exception {
126126
final String repository = createRepository(randomName());
127127
final String index = "index-no-merges";
128128
createIndex(index, Settings.builder()

0 commit comments

Comments
 (0)