From e574efd9c89e0351ae0e71400d2aa2f8d6241022 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 26 Mar 2025 13:01:07 +0000 Subject: [PATCH 1/2] Exercise multi-part uploads in S3 repo analysis tests Extends the max blob size to 10MiB, and sets the buffer size to 5MiB, to ensure that sometimes the S3 repo analysis tests will create blobs using the multipart upload flow. --- .../blobstore/testkit/analyze/S3RepositoryAnalysisRestIT.java | 2 ++ .../testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/snapshot-repo-test-kit/qa/s3/src/javaRestTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/S3RepositoryAnalysisRestIT.java b/x-pack/plugin/snapshot-repo-test-kit/qa/s3/src/javaRestTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/S3RepositoryAnalysisRestIT.java index c0f2b40f5a10f..e5930e02375b7 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/qa/s3/src/javaRestTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/S3RepositoryAnalysisRestIT.java +++ b/x-pack/plugin/snapshot-repo-test-kit/qa/s3/src/javaRestTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/S3RepositoryAnalysisRestIT.java @@ -9,6 +9,7 @@ import fixture.s3.S3HttpFixture; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.test.cluster.ElasticsearchCluster; import org.elasticsearch.test.cluster.local.distribution.DistributionType; import org.junit.ClassRule; @@ -59,6 +60,7 @@ protected Settings repositorySettings() { .put("bucket", bucket) .put("base_path", basePath) .put("delete_objects_max_size", between(1, 1000)) + .put("buffer_size", ByteSizeValue.ofMb(5)) // so some uploads are multipart ones .build(); } } diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java b/x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java index 2c96003f7e3d3..19e0072074fad 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java @@ -29,7 +29,7 @@ public void testRepositoryAnalysis() throws Exception { final Request request = new Request(HttpPost.METHOD_NAME, "/_snapshot/" + repository + "/_analyze"); request.addParameter("blob_count", "10"); request.addParameter("concurrency", "4"); - request.addParameter("max_blob_size", "1mb"); + request.addParameter("max_blob_size", randomFrom("1mb", "10mb")); // TODO NOCOMMIT revert this stuff into a separate PR request.addParameter("timeout", "120s"); request.addParameter("seed", Long.toString(randomLong())); assertOK(client().performRequest(request)); From 9c0373061a244ff3d0d816470d913968152a39a7 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 26 Mar 2025 13:59:55 +0000 Subject: [PATCH 2/2] Remove WIP comment --- .../testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java b/x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java index 19e0072074fad..a971772975128 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java @@ -29,7 +29,7 @@ public void testRepositoryAnalysis() throws Exception { final Request request = new Request(HttpPost.METHOD_NAME, "/_snapshot/" + repository + "/_analyze"); request.addParameter("blob_count", "10"); request.addParameter("concurrency", "4"); - request.addParameter("max_blob_size", randomFrom("1mb", "10mb")); // TODO NOCOMMIT revert this stuff into a separate PR + request.addParameter("max_blob_size", randomFrom("1mb", "10mb")); request.addParameter("timeout", "120s"); request.addParameter("seed", Long.toString(randomLong())); assertOK(client().performRequest(request));