From 25af2d0b0a3b2c8cc7c05374b3fe817106326620 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 20 Jun 2020 21:21:29 +0300 Subject: [PATCH] Fix bad integration test "always_fetch_merged" --- .../test_always_fetch_merged/test.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/integration/test_always_fetch_merged/test.py b/tests/integration/test_always_fetch_merged/test.py index 79458633081..f471ec78eac 100644 --- a/tests/integration/test_always_fetch_merged/test.py +++ b/tests/integration/test_always_fetch_merged/test.py @@ -50,18 +50,14 @@ def test_replica_always_download(started_cluster): # Nothing is merged assert node1.query("SELECT COUNT() FROM system.parts WHERE table = 'test_table' and active=1") == "10\n" - assert node2.query("SELECT COUNT() FROM system.parts WHERE table = 'test_table' and active=1") == "10\n" node1.query("SYSTEM START MERGES") + node1.query("OPTIMIZE TABLE test_table") + node2.query("SYSTEM SYNC REPLICA test_table") - for i in range(30): - node1_parts = node1.query("SELECT COUNT() FROM system.parts WHERE table = 'test_table' and active=1").strip() - node2_parts = node2.query("SELECT COUNT() FROM system.parts WHERE table = 'test_table' and active=1").strip() - if int(node1_parts) < 10 and int(node2_parts) < 10: - break - else: - time.sleep(0.5) - else: - assert int(node1_parts) < 10 - assert int(node2_parts) < 10 + node1_parts = node1.query("SELECT COUNT() FROM system.parts WHERE table = 'test_table' and active=1").strip() + node2_parts = node2.query("SELECT COUNT() FROM system.parts WHERE table = 'test_table' and active=1").strip() + + assert int(node1_parts) < 10 + assert int(node2_parts) < 10