Skip to content

Commit 4a6e634

Browse files
committed
Suppress aborting writes in repo analyzer tests
1 parent b813710 commit 4a6e634

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

x-pack/plugin/snapshot-repo-test-kit/qa/s3/src/javaRestTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/S3RepositoryAnalysisRestIT.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ protected String repositoryType() {
5454
return "s3";
5555
}
5656

57+
@Override
58+
protected boolean abortWritesPermitted() {
59+
// S3 SDK reads the full blob twice, once to compute the checksum and then again to do the upload; aborting a write operation blocks
60+
// the checksum computation rather than the actual upload.
61+
return false;
62+
}
63+
5764
@Override
5865
protected Settings repositorySettings() {
5966
final String bucket = System.getProperty("test.s3.bucket");

x-pack/plugin/snapshot-repo-test-kit/src/test/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractRepositoryAnalysisRestTestCase.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public abstract class AbstractRepositoryAnalysisRestTestCase extends ESRestTestC
1818

1919
protected abstract Settings repositorySettings();
2020

21+
protected boolean abortWritesPermitted() {
22+
return true;
23+
}
24+
2125
public void testRepositoryAnalysis() throws Exception {
2226
final String repositoryType = repositoryType();
2327
final Settings repositorySettings = repositorySettings();
@@ -32,6 +36,9 @@ public void testRepositoryAnalysis() throws Exception {
3236
request.addParameter("max_blob_size", randomFrom("1mb", "10mb"));
3337
request.addParameter("timeout", "120s");
3438
request.addParameter("seed", Long.toString(randomLong()));
39+
if (abortWritesPermitted() == false) {
40+
request.addParameter("rarely_abort_writes", "false");
41+
}
3542
assertOK(client().performRequest(request));
3643
}
3744

0 commit comments

Comments
 (0)