From d18f157de24feeeae9216bf8f9fa0f8fdab96824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Osipiuk?= Date: Mon, 27 Nov 2023 15:44:10 +0100 Subject: [PATCH] Add test timeouts --- .../deltalake/BaseDeltaFailureRecoveryTest.java | 7 +++++++ .../plugin/hive/BaseHiveFailureRecoveryTest.java | 14 ++++++++++++++ .../iceberg/BaseIcebergFailureRecoveryTest.java | 6 ++++++ .../io/trino/testing/BaseFailureRecoveryTest.java | 12 ++++++++++++ .../trino/testing/ExtendedFailureRecoveryTest.java | 7 +++++++ 5 files changed, 46 insertions(+) diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaFailureRecoveryTest.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaFailureRecoveryTest.java index 73c977c21545..9ecb6e39421f 100644 --- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaFailureRecoveryTest.java +++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaFailureRecoveryTest.java @@ -24,6 +24,7 @@ import io.trino.testing.QueryRunner; import io.trino.tpch.TpchTable; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.List; import java.util.Map; @@ -93,6 +94,7 @@ protected boolean areWriteRetriesSupported() } @Test + @Timeout(300) @Override protected void testDelete() { @@ -178,6 +180,7 @@ protected void testDelete() } @Test + @Timeout(300) @Override protected void testUpdate() { @@ -262,6 +265,7 @@ protected void testUpdate() } @Test + @Timeout(300) @Override // materialized views are currently not implemented by Delta connector protected void testRefreshMaterializedView() @@ -271,6 +275,7 @@ protected void testRefreshMaterializedView() } @Test + @Timeout(300) protected void testCreatePartitionedTable() { testTableModification( @@ -280,6 +285,7 @@ protected void testCreatePartitionedTable() } @Test + @Timeout(300) protected void testInsertIntoNewPartition() { testTableModification( @@ -289,6 +295,7 @@ protected void testInsertIntoNewPartition() } @Test + @Timeout(300) protected void testInsertIntoExistingPartition() { testTableModification( diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveFailureRecoveryTest.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveFailureRecoveryTest.java index 3505decc8c0e..ab8cc6ce9563 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveFailureRecoveryTest.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveFailureRecoveryTest.java @@ -17,6 +17,7 @@ import io.trino.operator.RetryPolicy; import io.trino.testing.ExtendedFailureRecoveryTest; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.List; import java.util.Optional; @@ -51,6 +52,7 @@ protected void createPartitionedLineitemTable(String tableName, List col } @Test + @Timeout(300) @Override // delete is unsupported for non ACID tables protected void testDelete() @@ -60,6 +62,7 @@ protected void testDelete() } @Test + @Timeout(300) @Override // delete is unsupported for non ACID tables protected void testDeleteWithSubquery() @@ -69,6 +72,7 @@ protected void testDeleteWithSubquery() } @Test + @Timeout(300) @Override // update is unsupported for non ACID tables protected void testUpdate() @@ -78,6 +82,7 @@ protected void testUpdate() } @Test + @Timeout(300) @Override // update is unsupported for non ACID tables protected void testUpdateWithSubquery() @@ -87,6 +92,7 @@ protected void testUpdateWithSubquery() } @Test + @Timeout(300) @Override protected void testMerge() { @@ -95,6 +101,7 @@ protected void testMerge() } @Test + @Timeout(300) @Override // materialized views are currently not implemented by Hive connector protected void testRefreshMaterializedView() @@ -104,6 +111,7 @@ protected void testRefreshMaterializedView() } @Test + @Timeout(300) protected void testCreatePartitionedTable() { testTableModification( @@ -113,6 +121,7 @@ protected void testCreatePartitionedTable() } @Test + @Timeout(300) protected void testInsertIntoNewPartition() { testTableModification( @@ -122,6 +131,7 @@ protected void testInsertIntoNewPartition() } @Test + @Timeout(300) protected void testInsertIntoExistingPartition() { testTableModification( @@ -131,6 +141,7 @@ protected void testInsertIntoExistingPartition() } @Test + @Timeout(300) protected void testInsertIntoNewPartitionBucketed() { testTableModification( @@ -140,6 +151,7 @@ protected void testInsertIntoNewPartitionBucketed() } @Test + @Timeout(300) protected void testInsertIntoExistingPartitionBucketed() { testTableModification( @@ -149,6 +161,7 @@ protected void testInsertIntoExistingPartitionBucketed() } @Test + @Timeout(300) protected void testReplaceExistingPartition() { testTableModification( @@ -161,6 +174,7 @@ protected void testReplaceExistingPartition() } @Test + @Timeout(300) protected void testDeletePartitionWithSubquery() { assertThatThrownBy(() -> { diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergFailureRecoveryTest.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergFailureRecoveryTest.java index c9f8d30f6212..db723d00ba8d 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergFailureRecoveryTest.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/BaseIcebergFailureRecoveryTest.java @@ -17,6 +17,7 @@ import io.trino.spi.ErrorType; import io.trino.testing.BaseFailureRecoveryTest; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.Optional; @@ -52,6 +53,7 @@ protected void testCreatePartitionedTable() // Copied from BaseDeltaFailureRecoveryTest @Test + @Timeout(300) @Override protected void testDelete() { @@ -130,6 +132,7 @@ protected void testDelete() // Copied from BaseDeltaFailureRecoveryTest @Test + @Timeout(300) @Override protected void testUpdate() { @@ -206,6 +209,7 @@ protected void testUpdate() } @Test + @Timeout(300) protected void testInsertIntoNewPartition() { testTableModification( @@ -215,6 +219,7 @@ protected void testInsertIntoNewPartition() } @Test + @Timeout(300) protected void testInsertIntoExistingPartition() { testTableModification( @@ -224,6 +229,7 @@ protected void testInsertIntoExistingPartition() } @Test + @Timeout(300) protected void testMergePartitionedTable() { testTableModification( diff --git a/testing/trino-testing/src/main/java/io/trino/testing/BaseFailureRecoveryTest.java b/testing/trino-testing/src/main/java/io/trino/testing/BaseFailureRecoveryTest.java index fff6eae42576..97673cf1d951 100644 --- a/testing/trino-testing/src/main/java/io/trino/testing/BaseFailureRecoveryTest.java +++ b/testing/trino-testing/src/main/java/io/trino/testing/BaseFailureRecoveryTest.java @@ -28,6 +28,7 @@ import io.trino.tpch.TpchTable; import org.assertj.core.api.AbstractThrowableAssert; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.Arrays; import java.util.HashMap; @@ -180,6 +181,7 @@ protected void testSelect(String query, Optional session, Consumer columns, String partitionColumn); @Test + @Timeout(300) protected void testSimpleSelect() { testSelect("SELECT * FROM nation"); } @Test + @Timeout(300) protected void testAggregation() { testSelect("SELECT orderStatus, count(*) FROM orders GROUP BY orderStatus"); } @Test + @Timeout(300) protected void testJoinDynamicFilteringDisabled() { @Language("SQL") String selectQuery = "SELECT * FROM partitioned_lineitem JOIN supplier ON partitioned_lineitem.suppkey = supplier.suppkey " + @@ -88,6 +92,7 @@ protected void testJoinDynamicFilteringDisabled() } @Test + @Timeout(300) protected void testJoinDynamicFilteringEnabled() { @Language("SQL") String selectQuery = "SELECT * FROM partitioned_lineitem JOIN supplier ON partitioned_lineitem.suppkey = supplier.suppkey " + @@ -107,6 +112,7 @@ protected void testJoinDynamicFilteringEnabled() } @Test + @Timeout(300) protected void testUserFailure() { // Some connectors have pushdowns enabled for arithmetic operations (like SqlServer), @@ -125,6 +131,7 @@ protected void testUserFailure() } @Test + @Timeout(300) @Override protected void testRequestTimeouts() {