Skip to content

Commit 15b6e85

Browse files
authored
Skip region validation in S3BlobStoreRepositoryTests (#127372)
Today these tests assert that the requests received by the handler are signed in region `us-east-1` with no region specified, but in fact when running in EC2 the SDK will pick up the actual region which may be different. This commit skips this region validation for now (it is tested elsewhere).
1 parent 32a4462 commit 15b6e85

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,9 @@ public void handle(final HttpExchange exchange) throws IOException {
645645
assertTrue(
646646
isValidAwsV4SignedAuthorizationHeader(
647647
"test_access_key",
648-
Objects.requireNonNullElse(region, "us-east-1"),
648+
// If unset, the region used by the SDK is usually going to be `us-east-1` but sometimes these tests run on bare EC2
649+
// machines and the SDK picks up the region from the IMDS there, so for now we use '*' to skip validation.
650+
Objects.requireNonNullElse(region, "*"),
649651
"s3",
650652
exchange.getRequestHeaders().getFirst("Authorization")
651653
)

0 commit comments

Comments
 (0)