Skip to content

Commit

Permalink
Add test timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Nov 27, 2023
1 parent fdde022 commit d18f157
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -93,6 +94,7 @@ protected boolean areWriteRetriesSupported()
}

@Test
@Timeout(300)
@Override
protected void testDelete()
{
Expand Down Expand Up @@ -178,6 +180,7 @@ protected void testDelete()
}

@Test
@Timeout(300)
@Override
protected void testUpdate()
{
Expand Down Expand Up @@ -262,6 +265,7 @@ protected void testUpdate()
}

@Test
@Timeout(300)
@Override
// materialized views are currently not implemented by Delta connector
protected void testRefreshMaterializedView()
Expand All @@ -271,6 +275,7 @@ protected void testRefreshMaterializedView()
}

@Test
@Timeout(300)
protected void testCreatePartitionedTable()
{
testTableModification(
Expand All @@ -280,6 +285,7 @@ protected void testCreatePartitionedTable()
}

@Test
@Timeout(300)
protected void testInsertIntoNewPartition()
{
testTableModification(
Expand All @@ -289,6 +295,7 @@ protected void testInsertIntoNewPartition()
}

@Test
@Timeout(300)
protected void testInsertIntoExistingPartition()
{
testTableModification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,6 +52,7 @@ protected void createPartitionedLineitemTable(String tableName, List<String> col
}

@Test
@Timeout(300)
@Override
// delete is unsupported for non ACID tables
protected void testDelete()
Expand All @@ -60,6 +62,7 @@ protected void testDelete()
}

@Test
@Timeout(300)
@Override
// delete is unsupported for non ACID tables
protected void testDeleteWithSubquery()
Expand All @@ -69,6 +72,7 @@ protected void testDeleteWithSubquery()
}

@Test
@Timeout(300)
@Override
// update is unsupported for non ACID tables
protected void testUpdate()
Expand All @@ -78,6 +82,7 @@ protected void testUpdate()
}

@Test
@Timeout(300)
@Override
// update is unsupported for non ACID tables
protected void testUpdateWithSubquery()
Expand All @@ -87,6 +92,7 @@ protected void testUpdateWithSubquery()
}

@Test
@Timeout(300)
@Override
protected void testMerge()
{
Expand All @@ -95,6 +101,7 @@ protected void testMerge()
}

@Test
@Timeout(300)
@Override
// materialized views are currently not implemented by Hive connector
protected void testRefreshMaterializedView()
Expand All @@ -104,6 +111,7 @@ protected void testRefreshMaterializedView()
}

@Test
@Timeout(300)
protected void testCreatePartitionedTable()
{
testTableModification(
Expand All @@ -113,6 +121,7 @@ protected void testCreatePartitionedTable()
}

@Test
@Timeout(300)
protected void testInsertIntoNewPartition()
{
testTableModification(
Expand All @@ -122,6 +131,7 @@ protected void testInsertIntoNewPartition()
}

@Test
@Timeout(300)
protected void testInsertIntoExistingPartition()
{
testTableModification(
Expand All @@ -131,6 +141,7 @@ protected void testInsertIntoExistingPartition()
}

@Test
@Timeout(300)
protected void testInsertIntoNewPartitionBucketed()
{
testTableModification(
Expand All @@ -140,6 +151,7 @@ protected void testInsertIntoNewPartitionBucketed()
}

@Test
@Timeout(300)
protected void testInsertIntoExistingPartitionBucketed()
{
testTableModification(
Expand All @@ -149,6 +161,7 @@ protected void testInsertIntoExistingPartitionBucketed()
}

@Test
@Timeout(300)
protected void testReplaceExistingPartition()
{
testTableModification(
Expand All @@ -161,6 +174,7 @@ protected void testReplaceExistingPartition()
}

@Test
@Timeout(300)
protected void testDeletePartitionWithSubquery()
{
assertThatThrownBy(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -52,6 +53,7 @@ protected void testCreatePartitionedTable()

// Copied from BaseDeltaFailureRecoveryTest
@Test
@Timeout(300)
@Override
protected void testDelete()
{
Expand Down Expand Up @@ -130,6 +132,7 @@ protected void testDelete()

// Copied from BaseDeltaFailureRecoveryTest
@Test
@Timeout(300)
@Override
protected void testUpdate()
{
Expand Down Expand Up @@ -206,6 +209,7 @@ protected void testUpdate()
}

@Test
@Timeout(300)
protected void testInsertIntoNewPartition()
{
testTableModification(
Expand All @@ -215,6 +219,7 @@ protected void testInsertIntoNewPartition()
}

@Test
@Timeout(300)
protected void testInsertIntoExistingPartition()
{
testTableModification(
Expand All @@ -224,6 +229,7 @@ protected void testInsertIntoExistingPartition()
}

@Test
@Timeout(300)
protected void testMergePartitionedTable()
{
testTableModification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -180,6 +181,7 @@ protected void testSelect(String query, Optional<Session> session, Consumer<Quer
}

@Test
@Timeout(300)
protected void testCreateTable()
{
testTableModification(
Expand All @@ -189,6 +191,7 @@ protected void testCreateTable()
}

@Test
@Timeout(300)
protected void testInsert()
{
testTableModification(
Expand All @@ -198,6 +201,7 @@ protected void testInsert()
}

@Test
@Timeout(300)
protected void testDelete()
{
testTableModification(
Expand All @@ -207,6 +211,7 @@ protected void testDelete()
}

@Test
@Timeout(300)
protected void testDeleteWithSubquery()
{
testTableModification(
Expand All @@ -216,6 +221,7 @@ protected void testDeleteWithSubquery()
}

@Test
@Timeout(300)
protected void testUpdate()
{
testTableModification(
Expand All @@ -225,6 +231,7 @@ protected void testUpdate()
}

@Test
@Timeout(300)
protected void testUpdateWithSubquery()
{
testTableModification(
Expand All @@ -234,6 +241,7 @@ protected void testUpdateWithSubquery()
}

@Test
@Timeout(300)
protected void testAnalyzeTable()
{
testNonSelect(
Expand All @@ -245,6 +253,7 @@ protected void testAnalyzeTable()
}

@Test
@Timeout(300)
protected void testMerge()
{
testTableModification(
Expand All @@ -262,6 +271,7 @@ protected void testMerge()
}

@Test
@Timeout(300)
protected void testRefreshMaterializedView()
{
testTableModification(
Expand All @@ -271,6 +281,7 @@ protected void testRefreshMaterializedView()
}

@Test
@Timeout(300)
protected void testExplainAnalyze()
{
testSelect("EXPLAIN ANALYZE SELECT orderStatus, count(*) FROM orders GROUP BY orderStatus");
Expand All @@ -282,6 +293,7 @@ protected void testExplainAnalyze()
}

@Test
@Timeout(300)
protected void testRequestTimeouts()
{
if (areWriteRetriesSupported()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.parallel.Execution;

import java.util.List;
Expand Down Expand Up @@ -68,18 +69,21 @@ public void initTables()
protected abstract void createPartitionedLineitemTable(String tableName, List<String> 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 " +
Expand All @@ -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 " +
Expand All @@ -107,6 +112,7 @@ protected void testJoinDynamicFilteringEnabled()
}

@Test
@Timeout(300)
protected void testUserFailure()
{
// Some connectors have pushdowns enabled for arithmetic operations (like SqlServer),
Expand All @@ -125,6 +131,7 @@ protected void testUserFailure()
}

@Test
@Timeout(300)
@Override
protected void testRequestTimeouts()
{
Expand Down

0 comments on commit d18f157

Please sign in to comment.