Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
46b27d1e
Commit
46b27d1e
authored
3 months ago
by
Dmitry Rodionov
Browse files
Options
Downloads
Patches
Plain Diff
test: retry query in test_user_can_read_from_query_cache to account for untimely rebalancing
parent
84384b38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1511
Dkr/investigate flaky
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/pgproto/user_can_read_from_query_cache_test.py
+11
-6
11 additions, 6 deletions
test/pgproto/user_can_read_from_query_cache_test.py
with
11 additions
and
6 deletions
test/pgproto/user_can_read_from_query_cache_test.py
+
11
−
6
View file @
46b27d1e
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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment