Merge pull request #11834 from ClickHouse/fix-test-always-merged

Fix bad integration test "always_fetch_merged"
This commit is contained in:
alexey-milovidov 2020-06-21 03:55:52 +03:00 committed by GitHub
commit bcf086e592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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