Skip to content

Commit

Permalink
Fix dropping tables in test "test_create_or_drop_tables_during_backup".
Browse files Browse the repository at this point in the history
  • Loading branch information
vitlibar committed Nov 20, 2023
1 parent 4cc2d6b commit 897cd06
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,13 @@ def drop_tables():
while time.time() < end_time:
table_name = f"mydb.tbl{randint(1, num_nodes)}"
node = nodes[randint(0, num_nodes - 1)]
node.query(f"DROP TABLE IF EXISTS {table_name} SYNC")
# "DROP TABLE IF EXISTS" still can throw some errors (e.g. "WRITE locking attempt on node0 has timed out!")
# So we use query_and_get_answer_with_error() to ignore any errors.
# `lock_acquire_timeout` is also reduced because we don't wait our test to wait too long.
node.query_and_get_answer_with_error(
f"DROP TABLE IF EXISTS {table_name} SYNC",
settings={"lock_acquire_timeout": 10},
)

def rename_tables():
while time.time() < end_time:
Expand Down

0 comments on commit 897cd06

Please sign in to comment.