|
65 | 65 | import static org.elasticsearch.repositories.blobstore.BlobStoreRepository.SNAPSHOT_NAME_FORMAT; |
66 | 66 | import static org.elasticsearch.repositories.blobstore.BlobStoreTestUtil.randomNonDataPurpose; |
67 | 67 | import static org.elasticsearch.repositories.blobstore.BlobStoreTestUtil.randomPurpose; |
| 68 | +import static org.elasticsearch.repositories.blobstore.BlobStoreTestUtil.randomRetryingPurpose; |
68 | 69 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; |
69 | 70 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; |
70 | 71 | import static org.hamcrest.Matchers.equalTo; |
@@ -157,7 +158,7 @@ public void testWriteMaybeCopyRead() throws IOException { |
157 | 158 | readBlobName = destinationBlobName; |
158 | 159 | } catch (UnsupportedOperationException ignored) {} |
159 | 160 | } |
160 | | - try (InputStream stream = container.readBlob(randomPurpose(), readBlobName)) { |
| 161 | + try (InputStream stream = container.readBlob(randomRetryingPurpose(), readBlobName)) { |
161 | 162 | BytesRefBuilder target = new BytesRefBuilder(); |
162 | 163 | while (target.length() < data.length) { |
163 | 164 | byte[] buffer = new byte[scaledRandomIntBetween(1, data.length - target.length())]; |
@@ -285,7 +286,7 @@ public static byte[] writeRandomBlob(BlobContainer container, String name, int l |
285 | 286 |
|
286 | 287 | public static byte[] readBlobFully(BlobContainer container, String name, int length) throws IOException { |
287 | 288 | byte[] data = new byte[length]; |
288 | | - try (InputStream inputStream = container.readBlob(randomPurpose(), name)) { |
| 289 | + try (InputStream inputStream = container.readBlob(randomRetryingPurpose(), name)) { |
289 | 290 | assertThat(Streams.readFully(inputStream, data), CoreMatchers.equalTo(length)); |
290 | 291 | assertThat(inputStream.read(), CoreMatchers.equalTo(-1)); |
291 | 292 | } |
|
0 commit comments