diff --git a/tests/integration/test_rename_column/test.py b/tests/integration/test_rename_column/test.py index 6bab0a28259..a664f1050e1 100644 --- a/tests/integration/test_rename_column/test.py +++ b/tests/integration/test_rename_column/test.py @@ -225,7 +225,9 @@ def select( def rename_column( node, table_name, name, new_name, iterations=1, ignore_exception=False ): - for i in range(iterations): + i = 0 + while True: + i += 1 try: node.query( "ALTER TABLE {table_name} RENAME COLUMN {name} to {new_name}".format( @@ -233,14 +235,22 @@ def rename_column( ) ) except QueryRuntimeException as ex: + if 'Coordination::Exception' in str(ex): + continue + if not ignore_exception: raise + if i >= iterations: + break + def rename_column_on_cluster( node, table_name, name, new_name, iterations=1, ignore_exception=False ): - for i in range(iterations): + i = 0 + while True: + i += 1 try: node.query( "ALTER TABLE {table_name} ON CLUSTER test_cluster RENAME COLUMN {name} to {new_name}".format( @@ -248,12 +258,21 @@ def rename_column_on_cluster( ) ) except QueryRuntimeException as ex: + if 'Coordination::Exception' in str(ex): + continue + if not ignore_exception: raise + if i >= iterations: + break + + def alter_move(node, table_name, iterations=1, ignore_exception=False): - for i in range(iterations): + i = 0 + while True: + i += 1 move_part = random.randint(0, 99) move_volume = "external" try: @@ -263,9 +282,16 @@ def alter_move(node, table_name, iterations=1, ignore_exception=False): ) ) except QueryRuntimeException as ex: + if 'Coordination::Exception' in str(ex): + continue + if not ignore_exception: raise + if i >= iterations: + break + + def test_rename_parallel_same_node(started_cluster): table_name = "test_rename_parallel_same_node"