Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify tests do not allocate resources early and do not leave them behind #15165

Merged
merged 39 commits into from
Nov 28, 2022
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d69f190
Remove redundant null check
findepi Nov 22, 2022
dc2e26a
Remove redundant closeAfterClass call
findepi Nov 24, 2022
26470f1
Use try-with-resources in TestHiveTransactionalTable
findepi Nov 25, 2022
acc98ce
Annotate reportListenerFailure as `@FormatMethod`
findepi Nov 22, 2022
07a85f4
Refactor TestLdapAuthenticator cleanup
findepi Nov 23, 2022
c1f5f82
Increase robustness of TestJdbcVendorCompatibility cleanup
findepi Nov 25, 2022
b3d4777
Fix indentation
findepi Nov 23, 2022
b5ede8b
Reorder methods for readability
findepi Nov 23, 2022
3a4d930
Fix resource leak in TestAnonymizeJsonRepresentation
findepi Nov 23, 2022
c000675
Fix resource leak in TestJsonRepresentation
findepi Nov 23, 2022
5e55f2f
Fix resource leak in TestSetSessionTask
findepi Nov 23, 2022
2ec7ae4
Fix resource leak in TestResetSessionTask
findepi Nov 23, 2022
dc29639
Fix resource leak in TestSetTimeZoneTask
findepi Nov 23, 2022
5f0fcab
Fix resource leak in TestStatsCalculator
findepi Nov 23, 2022
3853550
Fix resource leak in TestValidateScaledWritersUsage
findepi Nov 23, 2022
a244669
Fix resource leak in TestMemoryRevokingScheduler
findepi Nov 23, 2022
8d820a8
Fix resource leak in TestIcebergGetTableStatisticsOperations
findepi Nov 24, 2022
3841830
Fix resource leak in BaseJdbcConnectionCreationTest extenders
findepi Nov 24, 2022
370c458
Fix resource leak in TestPrometheusSplit
findepi Nov 24, 2022
75ca786
Fix resource leak in TestDruidTypeMapping
findepi Nov 24, 2022
6ae6b93
Fix resource leaks in Kudu connector tests
findepi Nov 24, 2022
bad7a65
Fix resource leak in TestGetTableStatisticsOperations
findepi Nov 24, 2022
819d2ac
Fix resource leak in TestPrometheusQueryMatrixResponseParse
findepi Nov 25, 2022
dcce266
Fix resource leak in TestPrometheusQueryScalarResponseParse
findepi Nov 25, 2022
5dbb14b
Fix resource leak in TestPrometheusQueryVectorResponseParse
findepi Nov 25, 2022
a8f3df7
Fix resource leak in TestIcebergSparkCompatibility
findepi Nov 25, 2022
d176c45
Fix CassandraSession resource leak in tests
findepi Nov 24, 2022
df2b3a7
Delay resource allocation in TestSqlTaskManager
findepi Nov 23, 2022
ad44778
Delay resource allocation in TestSqlTask
findepi Nov 23, 2022
9aab8be
Delay initialization in TestDeltaLakeGcsConnectorSmokeTest
findepi Nov 23, 2022
83a906c
Delay resource allocation in TestIcebergGcsConnectorSmokeTest
findepi Nov 23, 2022
f3e962e
Ensure TaskExecutor gets closed
findepi Nov 23, 2022
8233aa4
Free TestingTrinoServer and more instances in tests
findepi Nov 23, 2022
1eae356
Fix `@AfterClass` to include `alwaysRun = true`
findepi Nov 24, 2022
fc0ad15
Prevent use of closeAfterClass in a test constructor
findepi Nov 24, 2022
420bafa
Verify tests do not allocate resources early
findepi Nov 22, 2022
3826cd4
Log configuration methods too in ProgressLoggingListener
findepi Nov 25, 2022
08b24b6
Release memory in DistributedQueryRunner.close
findepi Nov 25, 2022
aa0e114
Fix field declaration placement in TestSetSessionTask
findepi Nov 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import io.trino.testing.LocalQueryRunner;
import io.trino.transaction.TransactionManager;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.net.URI;
Expand Down Expand Up @@ -69,15 +70,17 @@ private enum Size
LARGE,
}

private final TransactionManager transactionManager;
private final AccessControl accessControl;
private final Metadata metadata;
private final PlannerContext plannerContext;
private final SessionPropertyManager sessionPropertyManager;
private LocalQueryRunner queryRunner;
private TransactionManager transactionManager;
private AccessControl accessControl;
private Metadata metadata;
private PlannerContext plannerContext;
private SessionPropertyManager sessionPropertyManager;

public TestSetSessionTask()
@BeforeClass
public void setUp()
{
LocalQueryRunner queryRunner = LocalQueryRunner.builder(TEST_SESSION)
queryRunner = LocalQueryRunner.builder(TEST_SESSION)
.withExtraSystemSessionProperties(ImmutableSet.of(() -> ImmutableList.of(
stringProperty(
"foo",
Expand Down Expand Up @@ -129,6 +132,8 @@ private static void validatePositive(Object value)
@AfterClass(alwaysRun = true)
public void tearDown()
{
queryRunner.close();
findepi marked this conversation as resolved.
Show resolved Hide resolved
queryRunner = null;
executor.shutdownNow();
executor = null;
}
Expand Down