From 43dff9d34c2b7dc061a2ce0cab6e6d1f2a43750a Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Mon, 13 Jun 2022 19:44:12 +0000 Subject: [PATCH] Black --- .../test_distributed_format/test.py | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/tests/integration/test_distributed_format/test.py b/tests/integration/test_distributed_format/test.py index 0359e6b7d6f..5611f465e8b 100644 --- a/tests/integration/test_distributed_format/test.py +++ b/tests/integration/test_distributed_format/test.py @@ -6,7 +6,11 @@ import pytest from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) -node = cluster.add_instance("node", main_configs=["configs/remote_servers.xml", 'configs/another_remote_servers.xml'], stay_alive=True) +node = cluster.add_instance( + "node", + main_configs=["configs/remote_servers.xml", "configs/another_remote_servers.xml"], + stay_alive=True, +) cluster_param = pytest.mark.parametrize( "cluster", @@ -144,6 +148,7 @@ def test_single_file_old(started_cluster, cluster): node.query("drop table test.distr_3") + def test_remove_replica(started_cluster): node.query( "create table test.local_4 (x UInt64, s String) engine = MergeTree order by x" @@ -151,12 +156,28 @@ def test_remove_replica(started_cluster): node.query( "create table test.distr_4 (x UInt64, s String) engine = Distributed('test_cluster_remove_replica1', test, local_4)" ) - node.query("insert into test.distr_4 values (1, 'a'), (2, 'bb'), (3, 'ccc'), (4, 'dddd')") + node.query( + "insert into test.distr_4 values (1, 'a'), (2, 'bb'), (3, 'ccc'), (4, 'dddd')" + ) node.query("detach table test.distr_4") - node.exec_in_container(["sed", "-i", "s/test_cluster_remove_replica1/test_cluster_remove_replica_tmp/g", "/etc/clickhouse-server/config.d/another_remote_servers.xml"]) - node.exec_in_container(["sed", "-i", "s/test_cluster_remove_replica2/test_cluster_remove_replica1/g", "/etc/clickhouse-server/config.d/another_remote_servers.xml"]) + node.exec_in_container( + [ + "sed", + "-i", + "s/test_cluster_remove_replica1/test_cluster_remove_replica_tmp/g", + "/etc/clickhouse-server/config.d/another_remote_servers.xml", + ] + ) + node.exec_in_container( + [ + "sed", + "-i", + "s/test_cluster_remove_replica2/test_cluster_remove_replica1/g", + "/etc/clickhouse-server/config.d/another_remote_servers.xml", + ] + ) node.query("SYSTEM RELOAD CONFIG") node.query("attach table test.distr_4", ignore_error=True) node.query("SYSTEM FLUSH DISTRIBUTED test.distr_4", ignore_error=True) - assert node.query("select 1") == '1\n' + assert node.query("select 1") == "1\n"