File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
test/fixtures/s3-fixture/src/main/java/fixture/s3 Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 2525import org .elasticsearch .logging .LogManager ;
2626import org .elasticsearch .logging .Logger ;
2727import org .elasticsearch .rest .RestStatus ;
28+ import org .elasticsearch .test .ESTestCase ;
2829import org .elasticsearch .test .fixture .HttpHeaderParser ;
2930
3031import java .io .IOException ;
@@ -397,7 +398,13 @@ public void handle(final HttpExchange exchange) throws IOException {
397398 return ;
398399 }
399400
400- resultBuilder .append (errorBuilder .toString ()).append ("</DeleteResult>" );
401+ if (ESTestCase .randomBoolean ()) {
402+ // In practice the real S3 doesn't report errors for blobs that did not exist (this is the desired outcome after a
403+ // delete operation anyway) but this isn't documented, so other implementations may return these errors and can
404+ // legitimately expect Elasticsearch to handle them correctly.
405+ resultBuilder .append (errorBuilder );
406+ }
407+ resultBuilder .append ("</DeleteResult>" );
401408 byte [] response = resultBuilder .toString ().getBytes (StandardCharsets .UTF_8 );
402409 exchange .getResponseHeaders ().add ("Content-Type" , "application/xml" );
403410 exchange .sendResponseHeaders (RestStatus .OK .getStatus (), response .length );
You can’t perform that action at this time.
0 commit comments