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
db731905
Commit
db731905
authored
1 year ago
by
Georgy Moshkin
Committed by
Yaroslav Dynnikov
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
test: reduce test_vshard_updates_on_master_change flakiness
parent
f4275590
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/int/test_sharding.py
+20
-0
20 additions, 0 deletions
test/int/test_sharding.py
with
20 additions
and
0 deletions
test/int/test_sharding.py
+
20
−
0
View file @
db731905
...
...
@@ -4,6 +4,7 @@ import time
from
conftest
import
(
Cluster
,
Instance
,
Retriable
,
)
...
...
@@ -170,6 +171,18 @@ def get_vshards_opinion_about_replicaset_masters(i: Instance):
)
def
wait_current_vshard_config_changed
(
peer
:
Instance
,
old_current_vshard_config
,
timeout
=
5
):
def
impl
():
new_current_vshard_config
=
peer
.
eval
(
"
return box.space._pico_property:get(
'
current_vshard_config
'
).value
"
,
)
assert
new_current_vshard_config
!=
old_current_vshard_config
Retriable
(
timeout
=
timeout
,
rps
=
10
).
call
(
impl
)
def
test_vshard_updates_on_master_change
(
cluster
:
Cluster
):
i1
=
cluster
.
add_instance
(
replicaset_id
=
"
r1
"
,
wait_online
=
True
)
i2
=
cluster
.
add_instance
(
replicaset_id
=
"
r1
"
,
wait_online
=
True
)
...
...
@@ -185,6 +198,10 @@ def test_vshard_updates_on_master_change(cluster: Cluster):
assert
replicaset_masters
[
r1_uuid
]
==
i1
.
instance_id
assert
replicaset_masters
[
r2_uuid
]
==
i3
.
instance_id
old_vshard_config
=
i1
.
eval
(
"
return box.space._pico_property:get(
'
current_vshard_config
'
).value
"
)
cluster
.
cas
(
"
update
"
,
"
_pico_replicaset
"
,
...
...
@@ -199,6 +216,9 @@ def test_vshard_updates_on_master_change(cluster: Cluster):
)
cluster
.
raft_wait_index
(
index
)
# Wait for governor to change current master and update the vshard config.
wait_current_vshard_config_changed
(
i1
,
old_vshard_config
)
for
i
in
cluster
.
instances
:
replicaset_masters
=
get_vshards_opinion_about_replicaset_masters
(
i
)
# Now the chosen instances are replicaset masters
...
...
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