Fix flaky transactional queue e2e test (#1102)

This commit is contained in:
Andi 2023-07-29 11:11:27 +02:00 committed by GitHub
parent 2b7707a2f1
commit 9072fb7703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,6 +318,17 @@ def test_user_killing_some_transactions():
# Create another user1 connections
user_connection_1_copy = connect(username="user1", password="")
user_cursor_1_copy = user_connection_1_copy.cursor()
# Run in this while loop since it is possible that process 1 hasn't started yet.
query_not_started = True
time_passed = 0
while query_not_started:
query_not_started = len(execute_and_fetch_all(user_cursor_1_copy, "SHOW TRANSACTIONS")) != 2
time.sleep(1)
# Avoid running same test forever
time_passed += 1
if time_passed > 10:
assert False
show_user_1_results = show_transactions_test(user_cursor_1_copy, 2)
if show_user_1_results[0][2] == ["SHOW TRANSACTIONS"]:
execution_index = 0