Aiven-Open / tiered-storage-for-apache-kafka

RemoteStorageManager for Apache Kafka® Tiered Storage
Apache License 2.0
95 stars 20 forks source link

Avoid hostname errors from s3 integration tests #575

Closed elakito closed 3 months ago

elakito commented 3 months ago

Fixing the s3 integration tests.

The s3 integraion tests are using s3.bucket.name set to "test-bucket" and s3.endpoint.url set to "http://localhost:...". Then, the client uses the hostname test-bucket.localhost, which causes those tests to fail with UnknownHostException.

    Caused by: software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: test-bucket.localhost
        at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:111)
        at software.amazon.awssdk.core.exception.SdkClientException.create(SdkClientException.java:47)
        at software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:223)
        at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:83)
        at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:36)
        at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
        ...

In order to avoid this hostname problem, we should set s3.path.style.access.enabled to "true" in those tests. Please have a look. Thanks.