Skip to content

Commit b4869f5

Browse files
committed
test zero-sized blob
1 parent 019a04f commit b4869f5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,11 @@ public void testWriteBlobWithRetries() throws Exception {
265265
final CountDown countDown = new CountDown(maxRetries);
266266

267267
final BlobContainer blobContainer = blobContainerBuilder().maxRetries(maxRetries).build();
268-
final byte[] bytes = randomBlobContent();
268+
final byte[] bytes = randomBlobContent(0);
269269
httpServer.createContext("/upload/storage/v1/b/bucket/o", safeHandler(exchange -> {
270270
assertThat(exchange.getRequestURI().getQuery(), containsString("uploadType=multipart"));
271271
if (countDown.countDown()) {
272272
MultipartUpload multipartUpload = MultipartUpload.parseBody(exchange, exchange.getRequestBody());
273-
assertTrue(multipartUpload.content().length() > 0);
274273
assertEquals(multipartUpload.name(), blobContainer.path().buildAsString() + "write_blob_max_retries");
275274
if (multipartUpload.content().equals(new BytesArray(bytes))) {
276275
byte[] response = Strings.format("""

0 commit comments

Comments
 (0)