Skip to content

Commit 73ab371

Browse files
Mute GCS Retry Tests on JDK8 (#55372)
Same as #53119 but for the retries tests. Closes #55317
1 parent 389b649 commit 73ab371

File tree

2 files changed

+13
-57
lines changed

2 files changed

+13
-57
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import org.elasticsearch.test.ESTestCase;
5252
import org.junit.After;
5353
import org.junit.Before;
54+
import org.junit.BeforeClass;
5455
import org.threeten.bp.Duration;
5556

5657
import java.io.IOException;
@@ -100,6 +101,11 @@ private String httpServerUrl() {
100101
return "http://" + InetAddresses.toUriString(address.getAddress()) + ":" + address.getPort();
101102
}
102103

104+
@BeforeClass
105+
public static void skipJava8() {
106+
GoogleCloudStorageBlobStoreRepositoryTests.assumeNotJava8();
107+
}
108+
103109
@Before
104110
public void setUp() throws Exception {
105111
httpServer = MockHttpServer.createHttp(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);

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

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.elasticsearch.repositories.Repository;
5151
import org.elasticsearch.repositories.blobstore.BlobStoreRepository;
5252
import org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase;
53+
import org.junit.BeforeClass;
5354
import org.threeten.bp.Duration;
5455

5556
import java.io.IOException;
@@ -69,13 +70,18 @@
6970
@SuppressForbidden(reason = "this test uses a HttpServer to emulate a Google Cloud Storage endpoint")
7071
public class GoogleCloudStorageBlobStoreRepositoryTests extends ESMockAPIBasedRepositoryIntegTestCase {
7172

72-
private static void assumeNotJava8() {
73+
public static void assumeNotJava8() {
7374
assumeFalse("This test is flaky on jdk8 - we suspect a JDK bug to trigger some assertion in the HttpServer implementation used " +
7475
"to emulate the server side logic of Google Cloud Storage. See https://bugs.openjdk.java.net/browse/JDK-8180754, " +
7576
"https://github.com/elastic/elasticsearch/pull/51933 and https://github.com/elastic/elasticsearch/issues/52906 " +
7677
"for more background on this issue.", JavaVersion.current().equals(JavaVersion.parse("8")));
7778
}
7879

80+
@BeforeClass
81+
public static void skipJava8() {
82+
assumeNotJava8();
83+
}
84+
7985
@Override
8086
protected String repositoryType() {
8187
return GoogleCloudStorageRepository.TYPE;
@@ -123,7 +129,6 @@ protected Settings nodeSettings(int nodeOrdinal) {
123129
}
124130

125131
public void testDeleteSingleItem() {
126-
assumeNotJava8();
127132
final String repoName = createRepository(randomName());
128133
final RepositoriesService repositoriesService = internalCluster().getMasterNodeInstance(RepositoriesService.class);
129134
final BlobStoreRepository repository = (BlobStoreRepository) repositoriesService.repository(repoName);
@@ -170,62 +175,7 @@ public void testChunkSize() {
170175
assertEquals("failed to parse value [101mb] for setting [chunk_size], must be <= [100mb]", e.getMessage());
171176
}
172177

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-
227178
public void testWriteReadLarge() throws IOException {
228-
assumeNotJava8();
229179
try (BlobStore store = newBlobStore()) {
230180
final BlobContainer container = store.blobContainer(new BlobPath());
231181
byte[] data = randomBytes(GoogleCloudStorageBlobStore.LARGE_BLOB_THRESHOLD_BYTE_SIZE + 1);

0 commit comments

Comments
 (0)