|
28 | 28 | import fixture.gcs.GoogleCloudStorageHttpHandler; |
29 | 29 | import org.apache.lucene.util.BytesRef; |
30 | 30 | import org.apache.lucene.util.BytesRefBuilder; |
31 | | -import org.apache.lucene.util.LuceneTestCase; |
32 | 31 | import org.elasticsearch.action.ActionRunnable; |
33 | 32 | import org.elasticsearch.action.support.PlainActionFuture; |
| 33 | +import org.elasticsearch.bootstrap.JavaVersion; |
34 | 34 | import org.elasticsearch.cluster.metadata.RepositoryMetaData; |
35 | 35 | import org.elasticsearch.cluster.service.ClusterService; |
36 | 36 | import org.elasticsearch.common.SuppressForbidden; |
|
67 | 67 | import static org.elasticsearch.repositories.gcs.GoogleCloudStorageRepository.CLIENT_NAME; |
68 | 68 |
|
69 | 69 | @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") |
71 | 70 | public class GoogleCloudStorageBlobStoreRepositoryTests extends ESMockAPIBasedRepositoryIntegTestCase { |
72 | 71 |
|
| 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 | + |
73 | 79 | @Override |
74 | 80 | protected String repositoryType() { |
75 | 81 | return GoogleCloudStorageRepository.TYPE; |
@@ -117,6 +123,7 @@ protected Settings nodeSettings(int nodeOrdinal) { |
117 | 123 | } |
118 | 124 |
|
119 | 125 | public void testDeleteSingleItem() { |
| 126 | + assumeNotJava8(); |
120 | 127 | final String repoName = createRepository(randomName()); |
121 | 128 | final RepositoriesService repositoriesService = internalCluster().getMasterNodeInstance(RepositoriesService.class); |
122 | 129 | final BlobStoreRepository repository = (BlobStoreRepository) repositoriesService.repository(repoName); |
@@ -163,7 +170,62 @@ public void testChunkSize() { |
163 | 170 | assertEquals("failed to parse value [101mb] for setting [chunk_size], must be <= [100mb]", e.getMessage()); |
164 | 171 | } |
165 | 172 |
|
| 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 | + |
166 | 227 | public void testWriteReadLarge() throws IOException { |
| 228 | + assumeNotJava8(); |
167 | 229 | try (BlobStore store = newBlobStore()) { |
168 | 230 | final BlobContainer container = store.blobContainer(new BlobPath()); |
169 | 231 | byte[] data = randomBytes(GoogleCloudStorageBlobStore.LARGE_BLOB_THRESHOLD_BYTE_SIZE + 1); |
|
0 commit comments