Skip to content

Commit

Permalink
Set keep_alive_timeout as 10 seconds in ClickHouse testing server
Browse files Browse the repository at this point in the history
For avoiding below failure during copy of TPCH tables.
 ClickHouse exception, code: 1002, host: localhost, port: <port>;
 localhost:<port> failed to respond
  • Loading branch information
ebyhr committed Jan 11, 2022
1 parent fcdf74d commit 7e7c2c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import static java.lang.String.format;
import static org.testcontainers.containers.ClickHouseContainer.HTTP_PORT;
import static org.testcontainers.utility.MountableFile.forClasspathResource;

public class TestingClickHouseServer
implements Closeable
Expand All @@ -33,6 +34,7 @@ public TestingClickHouseServer()
{
// Use 2nd stable version
dockerContainer = (ClickHouseContainer) new ClickHouseContainer(CLICKHOUSE_IMAGE)
.withCopyFileToContainer(forClasspathResource("custom.xml"), "/etc/clickhouse-server/config.d/custom.xml")
.withStartupAttempts(10);

dockerContainer.start();
Expand Down
5 changes: 5 additions & 0 deletions plugin/trino-clickhouse/src/test/resources/custom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<yandex>
<!-- To avoid "failed to response" error message during copy of TPCH tables -->
<keep_alive_timeout>10</keep_alive_timeout>
</yandex>

0 comments on commit 7e7c2c7

Please sign in to comment.