From dbfb44829017e8703620d75a9c215f8995ddbea6 Mon Sep 17 00:00:00 2001 From: Igor Nikonov Date: Fri, 9 Sep 2022 14:39:06 +0000 Subject: [PATCH 1/2] Fix: integration test, standalone keeper mode There is logic regarding which keeper binary use to start keeper cluster in an integration test There 2 options: (1) standalone keeper binary (expected binary name clickhouse-keeper) (2) clickhouse binary with keeper inside Fixed: - option (1) didn't work since docker_compose_keeper.yaml didn't create target clickhouse-keeper at all - if clickhouse-keeper existed, option (1) was taken but clickhouse-keeper could be just a link to clickhouse binary (the link is created always during build if cmake option BUILD_STANDALONE_KEEPER is OFF) --- .../integration/runner/compose/docker_compose_keeper.yml | 9 +++++++++ tests/integration/helpers/cluster.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docker/test/integration/runner/compose/docker_compose_keeper.yml b/docker/test/integration/runner/compose/docker_compose_keeper.yml index 811bbdd800d..8524823ed87 100644 --- a/docker/test/integration/runner/compose/docker_compose_keeper.yml +++ b/docker/test/integration/runner/compose/docker_compose_keeper.yml @@ -8,6 +8,9 @@ services: - type: bind source: ${keeper_binary:-} target: /usr/bin/clickhouse + - type: bind + source: ${keeper_binary:-} + target: /usr/bin/clickhouse-keeper - type: bind source: ${keeper_config_dir1:-} target: /etc/clickhouse-keeper @@ -38,6 +41,9 @@ services: - type: bind source: ${keeper_binary:-} target: /usr/bin/clickhouse + - type: bind + source: ${keeper_binary:-} + target: /usr/bin/clickhouse-keeper - type: bind source: ${keeper_config_dir2:-} target: /etc/clickhouse-keeper @@ -68,6 +74,9 @@ services: - type: bind source: ${keeper_binary:-} target: /usr/bin/clickhouse + - type: bind + source: ${keeper_binary:-} + target: /usr/bin/clickhouse-keeper - type: bind source: ${keeper_config_dir3:-} target: /etc/clickhouse-keeper diff --git a/tests/integration/helpers/cluster.py b/tests/integration/helpers/cluster.py index ad1cefe6055..9cc515f98fc 100644 --- a/tests/integration/helpers/cluster.py +++ b/tests/integration/helpers/cluster.py @@ -792,7 +792,7 @@ class ClickHouseCluster: binary_dir = os.path.dirname(self.server_bin_path) # always prefer clickhouse-keeper standalone binary - if os.path.exists(os.path.join(binary_dir, "clickhouse-keeper")): + if os.path.exists(os.path.join(binary_dir, "clickhouse-keeper")) and not os.path.islink(os.path.join(binary_dir, "clickhouse-keeper")): binary_path = os.path.join(binary_dir, "clickhouse-keeper") keeper_cmd_prefix = "clickhouse-keeper" else: From 79ccce23e9190546a44593b4a794c40473527c54 Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Fri, 9 Sep 2022 20:09:54 +0000 Subject: [PATCH 2/2] Automatic style fix --- tests/integration/helpers/cluster.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/helpers/cluster.py b/tests/integration/helpers/cluster.py index 9cc515f98fc..e2cad8436a8 100644 --- a/tests/integration/helpers/cluster.py +++ b/tests/integration/helpers/cluster.py @@ -792,7 +792,9 @@ class ClickHouseCluster: binary_dir = os.path.dirname(self.server_bin_path) # always prefer clickhouse-keeper standalone binary - if os.path.exists(os.path.join(binary_dir, "clickhouse-keeper")) and not os.path.islink(os.path.join(binary_dir, "clickhouse-keeper")): + if os.path.exists( + os.path.join(binary_dir, "clickhouse-keeper") + ) and not os.path.islink(os.path.join(binary_dir, "clickhouse-keeper")): binary_path = os.path.join(binary_dir, "clickhouse-keeper") keeper_cmd_prefix = "clickhouse-keeper" else: