diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java index d77d078e5309..e4dc1c4d77e4 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java @@ -7889,8 +7889,9 @@ public void testOptimize() // compact with low threshold; nothing should change assertUpdate(optimizeEnabledSession, "ALTER TABLE " + tableName + " EXECUTE optimize(file_size_threshold => '10B')"); - assertThat(getTableFiles(tableName)).hasSameElementsAs(compactedFiles); + + assertUpdate("DROP TABLE " + tableName); } @Test @@ -7916,6 +7917,8 @@ public void testOptimizeWithWriterScaling() Set compactedFiles = getTableFiles(tableName); assertThat(compactedFiles).hasSize(1); assertThat(intersection(initialFiles, compactedFiles)).isEmpty(); + + assertUpdate("DROP TABLE " + tableName); } @Test @@ -7973,6 +7976,8 @@ public void testOptimizeWithPartitioning() Set compactedFiles = getTableFiles(tableName); assertThat(compactedFiles).hasSize(partitionsCount); assertThat(intersection(initialFiles, compactedFiles)).isEmpty(); + + assertUpdate("DROP TABLE " + tableName); } @Test @@ -7997,6 +8002,8 @@ public void testOptimizeWithBucketing() assertThat(getTableFiles(tableName)).hasSameElementsAs(initialFiles); assertNationNTimes(tableName, insertCount); + + assertUpdate("DROP TABLE " + tableName); } @Test @@ -8016,6 +8023,8 @@ public void testOptimizeHiveSystemTable() assertThatThrownBy(() -> computeActual(optimizeEnabledSession(), format("ALTER TABLE \"%s$partitions\" EXECUTE optimize(file_size_threshold => '10kB')", tableName))) .hasMessage("This connector does not support table procedures"); + + assertUpdate("DROP TABLE " + tableName); } private Session optimizeEnabledSession() diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java index 3090f8f3bd22..7a3418eecde2 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergConnectorTest.java @@ -3280,6 +3280,8 @@ public void testOptimizeForPartitionedTable() // as we force repartitioning there should be only 3 partitions assertThat(updatedFiles).hasSize(3); assertThat(getAllDataFilesFromTableDirectory(tableName)).containsExactlyInAnyOrderElementsOf(concat(initialFiles, updatedFiles)); + + assertUpdate("DROP TABLE " + tableName); } private List getActiveFiles(String tableName)