Skip to content
Snippets Groups Projects
Commit 46b27d1e authored by Dmitry Rodionov's avatar Dmitry Rodionov
Browse files

test: retry query in test_user_can_read_from_query_cache to account for untimely rebalancing

parent 84384b38
No related branches found
No related tags found
1 merge request!1511Dkr/investigate flaky
from conftest import Postgres
from conftest import Postgres, Retriable
import psycopg
......@@ -32,13 +32,18 @@ def test_user_can_read_from_query_cache(postgres: Postgres):
""",
)
# put this query in the query cache
cur = conn.execute(
"""
def select_returns_inserted():
cur = conn.execute(
"""
SELECT * FROM "t";
""",
)
assert sorted(cur.fetchall()) == [(1,), (2,)]
)
assert sorted(cur.fetchall()) == [(1,), (2,)]
# put this query in the query cache
# we have to retry because of vshard rebalancing problems
# see https://git.picodata.io/core/sbroad/-/issues/848
Retriable().call(select_returns_inserted)
# get this query from the cache
cur = conn.execute(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment