From 9a788c3cac7516d1fa2984a6a4da2b7ea8cbc38e Mon Sep 17 00:00:00 2001 From: Igor Nikonov Date: Mon, 25 Sep 2023 12:21:12 +0000 Subject: [PATCH] Fix: sync replicas to get consisten result --- .../test.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/integration/test_parallel_replicas_over_distributed/test.py b/tests/integration/test_parallel_replicas_over_distributed/test.py index 5716a33aa09..614d17e2edb 100644 --- a/tests/integration/test_parallel_replicas_over_distributed/test.py +++ b/tests/integration/test_parallel_replicas_over_distributed/test.py @@ -129,12 +129,6 @@ def test_parallel_replicas_over_distributed( node = nodes[0] expected_result = f"6003\t-1999\t1999\t3\n" - # w/o parallel replicas - assert ( - node.query(f"SELECT count(), min(key), max(key), sum(key) FROM {table_name}_d") - == expected_result - ) - # parallel replicas assert ( node.query( @@ -148,3 +142,12 @@ def test_parallel_replicas_over_distributed( ) == expected_result ) + + # sync all replicas to get consistent result by next distributed query + node.query(f"SYSTEM SYNC REPLICA ON CLUSTER {cluster} {table_name}") + + # w/o parallel replicas + assert ( + node.query(f"SELECT count(), min(key), max(key), sum(key) FROM {table_name}_d") + == expected_result + )