Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions amazon-redshift-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
<repository>
<id>redshift</id>
<url>http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

Expand Down
1 change: 1 addition & 0 deletions aurora-mysql-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<instructions>
<_exportcontents>
io.cdap.plugin.auroradb.mysql.*;
io.cdap.plugin.db.*;
io.cdap.plugin.db.source.*;
io.cdap.plugin.db.sink.*;
org.apache.commons.lang;
Expand Down
4 changes: 4 additions & 0 deletions cloudsql-mysql-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
<artifactId>mysql-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<!-- test dependencies -->
<dependency>
Expand Down
1 change: 0 additions & 1 deletion cloudsql-postgresql-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.0.1-jre</version>
</dependency>
<!-- test dependencies -->
<dependency>
Expand Down
1 change: 1 addition & 0 deletions generic-database-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<instructions>
<_exportcontents>
io.cdap.plugin.jdbc.*;
io.cdap.plugin.db.*;
io.cdap.plugin.db.source.*;
io.cdap.plugin.db.sink.*;
</_exportcontents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private static void prepareTestData(Connection conn) throws SQLException {

@AfterClass
public static void tearDownDB() throws SQLException {
if (!tearDown) {
if (!tearDown || hsqlDBServer == null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If an exception is thrown during the database teardown (for example, inside the try-with-resources block when dropping tables or getting a connection), hsqlDBServer.stop() will not be executed. This can cause the HSQLDB server to leak and remain running, potentially locking resources or affecting subsequent test suites.

Consider wrapping the teardown logic in a try-finally block to guarantee that hsqlDBServer.stop() is always called:

@AfterClass
public static void tearDownDB() throws SQLException {
  if (!tearDown || hsqlDBServer == null) {
    return;
  }

  try {
    try (Connection conn = hsqlDBServer.getConnection();
         Statement stmt = conn.createStatement()) {
      stmt.execute("DROP TABLE \"my_table\"");
      stmt.execute("DROP TABLE \"your_table\"");
      stmt.execute("DROP USER \"emptyPwdUser\"");
      stmt.execute("DROP TABLE \"MY_DEST_TABLE\"");
    }
  } finally {
    hsqlDBServer.stop();
  }
}

return;
}

Expand Down
21 changes: 8 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
<surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- version properties -->
<cdap.version>6.11.0</cdap.version>
<cdap.version>6.12.0-SNAPSHOT</cdap.version>
<cdap.plugin.version>2.13.1</cdap.plugin.version>
<guava.version>13.0.1</guava.version>
<guava.version>33.8.0-jre</guava.version>
<hadoop.version>3.3.6</hadoop.version>
<hsql.version>2.2.4</hsql.version>
<junit.version>4.13</junit.version>
Expand All @@ -98,6 +98,12 @@
<repository>
<id>sonatype-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

Expand Down Expand Up @@ -614,7 +620,6 @@
<properties>
<testSourceLocation>src/e2e-test/java</testSourceLocation>
<TEST_RUNNER>TestRunner.java</TEST_RUNNER>
<guava.version>32.1.2-jre</guava.version>
</properties>
<build>
<testResources>
Expand Down Expand Up @@ -709,16 +714,6 @@
</plugins>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Loading