Skip to content

Commit 69abc64

Browse files
authored
Disable request throttling in S3BlobStoreRepositoryTests (#46226)
When some high values are randomly picked up - for example the number of indices to snapshot or the number of snapshots to create - the tests in S3BlobStoreRepositoryTests can generate a high number of requests to the internal S3 server. In order to test the retry logic of the S3 client, the internal server is designed to randomly generate random server errors. When many requests are made, it is possible that the S3 client reaches its maximum number of successive retries capacity. Then the S3 client will stop retrying requests until enough retry attempts succeed, but it means that any request could fail before reaching the max retries count and make the test fail too. Closes #46217 Closes #46218 Closes #46219
1 parent 12a4177 commit 69abc64

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java

+5-19
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ protected Settings nodeSettings(int nodeOrdinal) {
121121
final String endpoint = "http://" + InetAddresses.toUriString(address.getAddress()) + ":" + address.getPort();
122122

123123
return Settings.builder()
124-
.put(Settings.builder()
125-
.put(S3ClientSettings.ENDPOINT_SETTING.getConcreteSettingForNamespace("test").getKey(), endpoint)
126-
// Disable chunked encoding as it simplifies a lot the request parsing on the httpServer side
127-
.put(S3ClientSettings.DISABLE_CHUNKED_ENCODING.getConcreteSettingForNamespace("test").getKey(), true)
128-
.build())
124+
.put(S3ClientSettings.ENDPOINT_SETTING.getConcreteSettingForNamespace("test").getKey(), endpoint)
125+
// Disable chunked encoding as it simplifies a lot the request parsing on the httpServer side
126+
.put(S3ClientSettings.DISABLE_CHUNKED_ENCODING.getConcreteSettingForNamespace("test").getKey(), true)
127+
// Disable request throttling because some random values in tests might generate too many failures for the S3 client
128+
.put(S3ClientSettings.USE_THROTTLE_RETRIES_SETTING.getConcreteSettingForNamespace("test").getKey(), false)
129129
.put(super.nodeSettings(nodeOrdinal))
130130
.setSecureSettings(secureSettings)
131131
.build();
@@ -284,18 +284,4 @@ private void handleAsError(final HttpExchange exchange, final String requestId)
284284
exchange.close();
285285
}
286286
}
287-
288-
// override here to mute only for S3, please remove this overload when un-muting
289-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/46218")
290-
@Override
291-
public void testSnapshotAndRestore() throws Exception {
292-
super.testSnapshotAndRestore();
293-
}
294-
295-
// override here to mute only for S3, pleaseremove this overload when un-muting
296-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/46219")
297-
@Override
298-
public void testMultipleSnapshotAndRollback() throws Exception {
299-
super.testMultipleSnapshotAndRollback();
300-
}
301287
}

0 commit comments

Comments
 (0)