diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04cc9b84c..a946873ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,7 +58,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: 'junit-report' + name: 'junit-report-integration' path: build/reports/tests/ retention-days: 5 @@ -82,6 +82,6 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: 'junit-report' + name: 'junit-report-community' path: build/reports/tests/ retention-days: 5 diff --git a/src/test/java/testsuite/integration/container/AuroraMysqlIntegrationBaseTest.java b/src/test/java/testsuite/integration/container/AuroraMysqlIntegrationBaseTest.java index cb956ead5..7d7a35e41 100644 --- a/src/test/java/testsuite/integration/container/AuroraMysqlIntegrationBaseTest.java +++ b/src/test/java/testsuite/integration/container/AuroraMysqlIntegrationBaseTest.java @@ -32,7 +32,6 @@ package testsuite.integration.container; import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; -import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.rds.RdsClient; import software.amazon.awssdk.services.rds.model.DBCluster; import software.amazon.awssdk.services.rds.model.DBClusterMember; @@ -135,6 +134,7 @@ public abstract class AuroraMysqlIntegrationBaseTest { protected String[] instanceIDs; // index 0 is always writer! protected int clusterSize = 0; + protected List clusterTopology; protected final ContainerHelper containerHelper = new ContainerHelper(); protected final AuroraTestUtility auroraUtil = new AuroraTestUtility(DB_REGION); @@ -200,6 +200,7 @@ public void setUpEach() throws InterruptedException, SQLException { assertTrue(clusterSize >= 2); // many tests assume that cluster contains at least a writer and a reader assertTrue(isDBInstanceWriter(instanceIDs[0])); makeSureInstancesUp(instanceIDs); + clusterTopology = getTopologyEndpoints(); } protected Properties initDefaultPropsNoTimeouts() { diff --git a/src/test/java/testsuite/integration/container/HikariCPIntegrationTest.java b/src/test/java/testsuite/integration/container/HikariCPIntegrationTest.java index 2907ccbb4..9b8e14ca3 100644 --- a/src/test/java/testsuite/integration/container/HikariCPIntegrationTest.java +++ b/src/test/java/testsuite/integration/container/HikariCPIntegrationTest.java @@ -50,7 +50,6 @@ import java.sql.Connection; import java.sql.SQLException; import java.sql.SQLTransientConnectionException; -import java.util.List; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -64,22 +63,6 @@ public class HikariCPIntegrationTest extends AuroraMysqlIntegrationBaseTest { private static Log log = null; private static final String URL_SUFFIX = PROXIED_DOMAIN_NAME_SUFFIX + ":" + MYSQL_PROXY_PORT; private static HikariDataSource data_source = null; - private final List clusterTopology = fetchTopology(); - - private List fetchTopology() { - try { - List topology = getTopologyEndpoints(); - // topology should contain a writer and at least one reader - if (topology == null || topology.size() < 2) { - fail("Topology does not contain the required instances"); - } - return topology; - } catch (SQLException e) { - fail("Couldn't fetch cluster topology"); - } - - return null; - } @BeforeAll static void setup() throws ClassNotFoundException { @@ -95,7 +78,12 @@ public void teardown() { } @BeforeEach - public void setUpTest() throws SQLException { + public void setUpTest() { + // topology should contain a writer and at least one reader + if (clusterTopology == null || clusterTopology.size() < 2) { + fail("Topology does not contain the required instances"); + } + String writerEndpoint = clusterTopology.get(0); String jdbcUrl = DB_CONN_STR_PREFIX + writerEndpoint + URL_SUFFIX;