diff --git a/ch_tools/chadmin/cli/wait_group.py b/ch_tools/chadmin/cli/wait_group.py index ff5c5e3..f384344 100644 --- a/ch_tools/chadmin/cli/wait_group.py +++ b/ch_tools/chadmin/cli/wait_group.py @@ -103,14 +103,13 @@ def wait_replication_sync_command( for replica in list_table_replicas(ctx): full_name = f"`{replica['database']}`.`{replica['table']}`" time_left = deadline - time.time() - timeout = min(replica_timeout.total_seconds(), time_left) execute_query( ctx, f"SYSTEM SYNC REPLICA {full_name}", format_=None, - timeout=time_left, - settings={"receive_timeout": timeout}, + timeout=replica_timeout.total_seconds(), + settings={"receive_timeout": time_left}, ) except requests.exceptions.ReadTimeout: logging.error("Read timeout while running query.") diff --git a/tests/features/chadmin.feature b/tests/features/chadmin.feature index 204130f..b571c5a 100644 --- a/tests/features/chadmin.feature +++ b/tests/features/chadmin.feature @@ -145,7 +145,7 @@ Feature: chadmin commands. """ Then it fails with response contains """ - Timeout while running query. + Read timeout while running query. """ When we execute query on clickhouse01 """