mzitnik commented on code in PR #24424:
URL: https://github.com/apache/beam/pull/24424#discussion_r1039480723
##########
sdks/java/io/clickhouse/src/test/java/org/apache/beam/sdk/io/clickhouse/BaseClickHouseTest.java:
##########
@@ -80,65 +58,21 @@ public static void setup() throws IOException,
InterruptedException {
zookeeper.start();
clickHouse =
- (ClickHouseContainer)
- new ClickHouseContainer(CLICKHOUSE_IMAGE)
- .withStartupAttempts(10)
- .withCreateContainerCmdModifier(
- // type inference for `(CreateContainerCmd) -> cmd.`
doesn't work
- cmd ->
- ((CreateContainerCmd) cmd)
- .withMemory(256 * 1024 * 1024L)
- .withMemorySwap(4L * 1024 * 1024 * 1024L))
- .withNetwork(network)
- .withClasspathResourceMapping(
- "config.d/zookeeper_default.xml",
- "/etc/clickhouse-server/config.d/zookeeper_default.xml",
- BindMode.READ_ONLY);
-
- BackOff backOff =
- FluentBackoff.DEFAULT
- .withMaxRetries(3)
- .withInitialBackoff(Duration.standardSeconds(15))
- .backoff();
-
- // try to start clickhouse-server a couple of times, see BEAM-6639
- while (true) {
- try {
- Unreliables.retryUntilSuccess(
- 10,
- () -> {
- DockerClientFactory.instance()
- .checkAndPullImage(DockerClientFactory.instance().client(),
CLICKHOUSE_IMAGE);
-
- return null;
- });
-
- clickHouse.start();
- break;
- } catch (Exception e) {
- if (!BackOffUtils.next(Sleeper.DEFAULT, backOff)) {
- throw e;
- } else {
- List<Image> images =
-
DockerClientFactory.instance().client().listImagesCmd().withShowAll(true).exec();
- String listImagesOutput = "listImagesCmd:\n" +
Joiner.on('\n').join(images) + "\n";
-
- LOG.warn("failed to start clickhouse-server\n\n" + listImagesOutput,
e);
- }
- }
- }
+ new ClickHouseContainer("clickhouse/clickhouse-server:22.5")
Review Comment:
Change to 22.9
##########
sdks/java/io/clickhouse/src/test/java/org/apache/beam/sdk/io/clickhouse/BaseClickHouseTest.java:
##########
@@ -80,65 +58,21 @@ public static void setup() throws IOException,
InterruptedException {
zookeeper.start();
clickHouse =
- (ClickHouseContainer)
- new ClickHouseContainer(CLICKHOUSE_IMAGE)
- .withStartupAttempts(10)
- .withCreateContainerCmdModifier(
- // type inference for `(CreateContainerCmd) -> cmd.`
doesn't work
- cmd ->
- ((CreateContainerCmd) cmd)
- .withMemory(256 * 1024 * 1024L)
- .withMemorySwap(4L * 1024 * 1024 * 1024L))
- .withNetwork(network)
- .withClasspathResourceMapping(
- "config.d/zookeeper_default.xml",
- "/etc/clickhouse-server/config.d/zookeeper_default.xml",
- BindMode.READ_ONLY);
-
- BackOff backOff =
- FluentBackoff.DEFAULT
- .withMaxRetries(3)
- .withInitialBackoff(Duration.standardSeconds(15))
- .backoff();
-
- // try to start clickhouse-server a couple of times, see BEAM-6639
- while (true) {
- try {
- Unreliables.retryUntilSuccess(
- 10,
- () -> {
- DockerClientFactory.instance()
- .checkAndPullImage(DockerClientFactory.instance().client(),
CLICKHOUSE_IMAGE);
-
- return null;
- });
-
- clickHouse.start();
- break;
- } catch (Exception e) {
- if (!BackOffUtils.next(Sleeper.DEFAULT, backOff)) {
- throw e;
- } else {
- List<Image> images =
-
DockerClientFactory.instance().client().listImagesCmd().withShowAll(true).exec();
- String listImagesOutput = "listImagesCmd:\n" +
Joiner.on('\n').join(images) + "\n";
-
- LOG.warn("failed to start clickhouse-server\n\n" + listImagesOutput,
e);
- }
- }
- }
+ new ClickHouseContainer("clickhouse/clickhouse-server:22.5")
+ .withStartupAttempts(10)
+ .withNetwork(network)
+ .withClasspathResourceMapping(
+ "config.d/zookeeper_default.xml",
+ "/etc/clickhouse-server/config.d/zookeeper_default.xml",
+ BindMode.READ_ONLY);
+ ;
+ clickHouse.start();
+ LOG.info("Start Clickhouse");
}
@AfterClass
public static void tearDown() {
clickHouse.close();
- zookeeper.close();
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]