diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestS3WrongRegionPicked.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestS3WrongRegionPicked.java index 2d8608c6942c..e1c48c09ba4f 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestS3WrongRegionPicked.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/s3/TestS3WrongRegionPicked.java @@ -27,12 +27,15 @@ public class TestS3WrongRegionPicked public void testS3WrongRegionSelection() throws Exception { - try (HiveMinioDataLake dataLake = new HiveMinioDataLake("test-bucket").start(); + // Bucket names are global so a unique one needs to be used. + String bucketName = "test-bucket" + randomTableSuffix(); + + try (HiveMinioDataLake dataLake = new HiveMinioDataLake(bucketName).start(); QueryRunner queryRunner = S3HiveQueryRunner.builder(dataLake) .setHiveProperties(ImmutableMap.of("hive.s3.region", "eu-central-1")) // Different than the default one .build()) { String tableName = "s3_region_test_" + randomTableSuffix(); - queryRunner.execute("CREATE TABLE default." + tableName + " (a int) WITH (external_location = 's3://test-bucket/" + tableName + "')"); + queryRunner.execute("CREATE TABLE default." + tableName + " (a int) WITH (external_location = 's3://" + bucketName + "/" + tableName + "')"); assertThatThrownBy(() -> queryRunner.execute("SELECT * FROM default." + tableName)) .getRootCause() .hasMessageContaining("Status Code: 400")