Skip to content

Commit

Permalink
Merge pull request #57007 from vitlibar/fix-dropping-tables-in-test_c…
Browse files Browse the repository at this point in the history
…reate_or_drop_tables_during_backup

Fix dropping tables in test_create_or_drop_tables_during_backup
  • Loading branch information
vitlibar committed Nov 21, 2023
2 parents 0ebe4ed + 897cd06 commit 4052ae8
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 4052ae8

Please sign in to comment.