Skip to content

Commit

Permalink
Mute GoogleCloudStorageBlobStoreRepositoryTests on jdk8 (#53119)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tlrx committed Mar 5, 2020
1 parent 2878ec8 commit d2bcec0
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
import fixture.gcs.GoogleCloudStorageHttpHandler;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.action.ActionRunnable;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.bootstrap.JavaVersion;
import org.elasticsearch.cluster.metadata.RepositoryMetaData;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.SuppressForbidden;
Expand Down Expand Up @@ -67,9 +67,15 @@
import static org.elasticsearch.repositories.gcs.GoogleCloudStorageRepository.CLIENT_NAME;

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

private static void assumeNotJava8() {
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 GoogleCloudStorageRepository.TYPE;
Expand Down Expand Up @@ -117,6 +123,7 @@ protected Settings nodeSettings(int nodeOrdinal) {
}

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

@Override
public void testSnapshotAndRestore() throws Exception {
assumeNotJava8();
super.testSnapshotAndRestore();
}

@Override
public void testList() throws IOException {
assumeNotJava8();
super.testList();
}

@Override
public void testIndicesDeletedFromRepository() throws Exception {
assumeNotJava8();
super.testIndicesDeletedFromRepository();
}

@Override
public void testDeleteBlobs() throws IOException {
assumeNotJava8();
super.testDeleteBlobs();
}

@Override
public void testWriteRead() throws IOException {
assumeNotJava8();
super.testWriteRead();
}

@Override
public void testReadNonExistingPath() throws IOException {
assumeNotJava8();
super.testReadNonExistingPath();
}

@Override
public void testContainerCreationAndDeletion() throws IOException {
assumeNotJava8();
super.testContainerCreationAndDeletion();
}

@Override
public void testMultipleSnapshotAndRollback() throws Exception {
assumeNotJava8();
super.testMultipleSnapshotAndRollback();
}

@Override
public void testSnapshotWithLargeSegmentFiles() throws Exception {
assumeNotJava8();
super.testSnapshotWithLargeSegmentFiles();
}

public void testWriteReadLarge() throws IOException {
assumeNotJava8();
try (BlobStore store = newBlobStore()) {
final BlobContainer container = store.blobContainer(new BlobPath());
byte[] data = randomBytes(GoogleCloudStorageBlobStore.LARGE_BLOB_THRESHOLD_BYTE_SIZE + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void tearDownHttpServer() {
/**
* Test the snapshot and restore of an index which has large segments files.
*/
public final void testSnapshotWithLargeSegmentFiles() throws Exception {
public void testSnapshotWithLargeSegmentFiles() throws Exception {
final String repository = createRepository(randomName());
final String index = "index-no-merges";
createIndex(index, Settings.builder()
Expand Down

0 comments on commit d2bcec0

Please sign in to comment.