Skip to content

Commit

Permalink
Modified integration tests to close hikari connection pool.
Browse files Browse the repository at this point in the history
  • Loading branch information
subkanthi committed Feb 6, 2025
1 parent 96fca9c commit 79d666a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public void startContainers() throws InterruptedException {
.withPassword("password")
.withClasspathResourceMapping("config_replicated.xml", "/etc/clickhouse-server/config.d/config.xml", BindMode.READ_ONLY)
.withClasspathResourceMapping("macros.xml", "/etc/clickhouse-server/config.d/macros.xml", BindMode.READ_ONLY)
.withExposedPorts(8123)
.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
.withExposedPorts(8123);
//.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
clickHouseContainer.withNetwork(network).withNetworkAliases("clickhouse");
clickHouseContainer.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ public void startContainers() throws InterruptedException {
.withPassword("password")
.withClasspathResourceMapping("config_replicated.xml", "/etc/clickhouse-server/config.d/config.xml", BindMode.READ_ONLY)
.withClasspathResourceMapping("macros.xml", "/etc/clickhouse-server/config.d/macros.xml", BindMode.READ_ONLY)
.withExposedPorts(8123)
.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
.withExposedPorts(8123);
//.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort())

clickHouseContainer.withNetwork(network).withNetworkAliases("clickhouse");
clickHouseContainer.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public void startContainers() throws InterruptedException {
.withPassword("password")
.withClasspathResourceMapping("config_replicated.xml", "/etc/clickhouse-server/config.d/config.xml", BindMode.READ_ONLY)
.withClasspathResourceMapping("macros.xml", "/etc/clickhouse-server/config.d/macros.xml", BindMode.READ_ONLY)
.withExposedPorts(8123)
.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
.withExposedPorts(8123);
//.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
clickHouseContainer.withNetwork(network).withNetworkAliases("clickhouse");
clickHouseContainer.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ public void startContainers() throws InterruptedException {
// clickHouseContainer.start();
Thread.sleep(15000);

clickHouseContainer = new ClickHouseContainer(DockerImageName.parse("clickhouse/clickhouse-server:latest")
clickHouseContainer = new ClickHouseContainer(DockerImageName.parse("clickhouse/clickhouse-server:23.8")
.asCompatibleSubstituteFor("clickhouse"))
.withInitScript("init_clickhouse_it.sql")
.withUsername("ch_user")
.withPassword("password")
.withClasspathResourceMapping("config_replicated.xml", "/etc/clickhouse-server/config.d/config.xml", BindMode.READ_ONLY)
.withClasspathResourceMapping("macros.xml", "/etc/clickhouse-server/config.d/macros.xml", BindMode.READ_ONLY)
.withExposedPorts(8123)
.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
.withExposedPorts(8123);

// .waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
clickHouseContainer.withNetwork(network).withNetworkAliases("clickhouse");
clickHouseContainer.start();
}
Expand Down Expand Up @@ -104,7 +105,7 @@ public void testReplicatedRMTAutoCreate(String clickHouseServerVersion) throws E

BaseDbWriter writer = ITCommon.getDBWriter(clickHouseContainer);

ResultSet rs = writer.executeQueryWithResultSet("show create table string_types_MEDIUMTEXT_utf8mb4");
ResultSet rs = writer.executeQueryWithResultSet("show create table employees.string_types_MEDIUMTEXT_utf8mb4");
// Validate that all the tables are created.
boolean resultValidated = false;
while(rs.next()) {
Expand All @@ -118,7 +119,7 @@ public void testReplicatedRMTAutoCreate(String clickHouseServerVersion) throws E

boolean dataValidated = false;
// Validate temporal_types_DATETIME data.
ResultSet dateTimeResult = writer.executeQueryWithResultSet("select * from string_types_MEDIUMTEXT_utf8mb4");
ResultSet dateTimeResult = writer.executeQueryWithResultSet("select * from employees.string_types_MEDIUMTEXT_utf8mb4");

while(dateTimeResult.next()) {
dataValidated = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public void startContainers() throws InterruptedException {
.withPassword("password")
.withClasspathResourceMapping("config_replicated.xml", "/etc/clickhouse-server/config.d/config.xml", BindMode.READ_ONLY)
.withClasspathResourceMapping("macros.xml", "/etc/clickhouse-server/config.d/macros.xml", BindMode.READ_ONLY)
.withExposedPorts(8123)
.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
.withExposedPorts(8123);
// .waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
clickHouseContainer.withNetwork(network).withNetworkAliases("clickhouse");
clickHouseContainer.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public void startContainers() throws InterruptedException {
.withPassword("password")
.withClasspathResourceMapping("config_replicated.xml", "/etc/clickhouse-server/config.d/config.xml", BindMode.READ_ONLY)
.withClasspathResourceMapping("macros.xml", "/etc/clickhouse-server/config.d/macros.xml", BindMode.READ_ONLY)
.withExposedPorts(8123)
.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
.withExposedPorts(8123);
//.waitingFor(new HttpWaitStrategy().forPort(zookeeperContainer.getFirstMappedPort()));
clickHouseContainer.withNetwork(network).withNetworkAliases("clickhouse");
// clickHouseContainer.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void testAutoCreateTable(String clickHouseServerVersion) throws Exception

BaseDbWriter writer = ITCommon.getDBWriter(clickHouseContainer);
Thread.sleep(10000);
ResultSet dateTimeResult = writer.executeQueryWithResultSet("select count(*) from `new-table`");
ResultSet dateTimeResult = writer.executeQueryWithResultSet("select count(*) from `employees.new-table`");
boolean resultReceived = false;

while(dateTimeResult.next()) {
Expand Down

0 comments on commit 79d666a

Please sign in to comment.