|
50 | 50 | import org.elasticsearch.repositories.Repository;
|
51 | 51 | import org.elasticsearch.repositories.blobstore.BlobStoreRepository;
|
52 | 52 | import org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase;
|
| 53 | +import org.junit.BeforeClass; |
53 | 54 | import org.threeten.bp.Duration;
|
54 | 55 |
|
55 | 56 | import java.io.IOException;
|
|
69 | 70 | @SuppressForbidden(reason = "this test uses a HttpServer to emulate a Google Cloud Storage endpoint")
|
70 | 71 | public class GoogleCloudStorageBlobStoreRepositoryTests extends ESMockAPIBasedRepositoryIntegTestCase {
|
71 | 72 |
|
72 |
| - private static void assumeNotJava8() { |
| 73 | + public static void assumeNotJava8() { |
73 | 74 | assumeFalse("This test is flaky on jdk8 - we suspect a JDK bug to trigger some assertion in the HttpServer implementation used " +
|
74 | 75 | "to emulate the server side logic of Google Cloud Storage. See https://bugs.openjdk.java.net/browse/JDK-8180754, " +
|
75 | 76 | "https://github.com/elastic/elasticsearch/pull/51933 and https://github.com/elastic/elasticsearch/issues/52906 " +
|
76 | 77 | "for more background on this issue.", JavaVersion.current().equals(JavaVersion.parse("8")));
|
77 | 78 | }
|
78 | 79 |
|
| 80 | + @BeforeClass |
| 81 | + public static void skipJava8() { |
| 82 | + assumeNotJava8(); |
| 83 | + } |
| 84 | + |
79 | 85 | @Override
|
80 | 86 | protected String repositoryType() {
|
81 | 87 | return GoogleCloudStorageRepository.TYPE;
|
@@ -123,7 +129,6 @@ protected Settings nodeSettings(int nodeOrdinal) {
|
123 | 129 | }
|
124 | 130 |
|
125 | 131 | public void testDeleteSingleItem() {
|
126 |
| - assumeNotJava8(); |
127 | 132 | final String repoName = createRepository(randomName());
|
128 | 133 | final RepositoriesService repositoriesService = internalCluster().getMasterNodeInstance(RepositoriesService.class);
|
129 | 134 | final BlobStoreRepository repository = (BlobStoreRepository) repositoriesService.repository(repoName);
|
@@ -170,62 +175,7 @@ public void testChunkSize() {
|
170 | 175 | assertEquals("failed to parse value [101mb] for setting [chunk_size], must be <= [100mb]", e.getMessage());
|
171 | 176 | }
|
172 | 177 |
|
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 |
| - |
227 | 178 | public void testWriteReadLarge() throws IOException {
|
228 |
| - assumeNotJava8(); |
229 | 179 | try (BlobStore store = newBlobStore()) {
|
230 | 180 | final BlobContainer container = store.blobContainer(new BlobPath());
|
231 | 181 | byte[] data = randomBytes(GoogleCloudStorageBlobStore.LARGE_BLOB_THRESHOLD_BYTE_SIZE + 1);
|
|
0 commit comments