Skip to content

Commit 9ee1e23

Browse files
committed
Skip region validation in S3BlobStoreRepositoryTests (elastic#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 1d1e85d commit 9ee1e23

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
@@ -617,7 +617,9 @@ public void handle(final HttpExchange exchange) throws IOException {
617617
assertTrue(
618618
isValidAwsV4SignedAuthorizationHeader(
619619
"test_access_key",
620-
Objects.requireNonNullElse(region, "us-east-1"),
620+
// If unset, the region used by the SDK is usually going to be `us-east-1` but sometimes these tests run on bare EC2
621+
// machines and the SDK picks up the region from the IMDS there, so for now we use '*' to skip validation.
622+
Objects.requireNonNullElse(region, "*"),
621623
"s3",
622624
exchange.getRequestHeaders().getFirst("Authorization")
623625
)

0 commit comments

Comments
 (0)