From e3a1af654293bc564aa8307ba878124de46cb1f3 Mon Sep 17 00:00:00 2001 From: kssenii Date: Wed, 11 Jan 2023 15:51:01 +0100 Subject: [PATCH] Fix flacky test --- tests/integration/test_multiple_disks/test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_multiple_disks/test.py b/tests/integration/test_multiple_disks/test.py index 83817ba7a3d..b041959ac21 100644 --- a/tests/integration/test_multiple_disks/test.py +++ b/tests/integration/test_multiple_disks/test.py @@ -1625,6 +1625,7 @@ def test_rename(start_cluster): """ ) + # jbod1 disk is 40mb for _ in range(5): data = [] for i in range(10): @@ -1635,7 +1636,13 @@ def test_rename(start_cluster): ) ) - disks = get_used_disks_for_table(node1, "renaming_table") + # data is moved in the background, so check with retries + num_try = 0 + while get_used_disks_for_table(node1, "renaming_table") == 1: + time.sleep(1) + num_try += 1 + if num_try == 20: + break assert len(disks) > 1 assert node1.query("SELECT COUNT() FROM default.renaming_table") == "50\n"