Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ea63aea7
Commit
ea63aea7
authored
Apr 28, 2020
by
Oran Agra
Committed by
antirez
Apr 28, 2020
Browse files
fix loading race in psync2 tests
parent
64e588bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/integration/psync2-pingoff.tcl
View file @
ea63aea7
...
@@ -20,6 +20,7 @@ start_server {} {
...
@@ -20,6 +20,7 @@ start_server {} {
$R
(
1
)
replicaof $R_host
(
0
)
$R_port
(
0
)
$R
(
1
)
replicaof $R_host
(
0
)
$R_port
(
0
)
$R
(
0
)
set foo bar
$R
(
0
)
set foo bar
wait_for_condition 50 1000
{
wait_for_condition 50 1000
{
[
status $R
(
1
)
master_link_status
]
==
"up"
&&
[
$R
(
0
)
dbsize
]
== 1 &&
[
$R
(
1
)
dbsize
]
== 1
[
$R
(
0
)
dbsize
]
== 1 &&
[
$R
(
1
)
dbsize
]
== 1
}
else
{
}
else
{
fail
"Replicas not replicating from master"
fail
"Replicas not replicating from master"
...
...
tests/integration/psync2-reg.tcl
View file @
ea63aea7
...
@@ -28,7 +28,10 @@ start_server {} {
...
@@ -28,7 +28,10 @@ start_server {} {
$R
(
2
)
slaveof $R_host
(
0
)
$R_port
(
0
)
$R
(
2
)
slaveof $R_host
(
0
)
$R_port
(
0
)
$R
(
0
)
set foo bar
$R
(
0
)
set foo bar
wait_for_condition 50 1000
{
wait_for_condition 50 1000
{
[
$R
(
1
)
dbsize
]
== 1 &&
[
$R
(
2
)
dbsize
]
== 1
[
status $R
(
1
)
master_link_status
]
==
"up"
&&
[
status $R
(
2
)
master_link_status
]
==
"up"
&&
[
$R
(
1
)
dbsize
]
== 1 &&
[
$R
(
2
)
dbsize
]
== 1
}
else
{
}
else
{
fail
"Replicas not replicating from master"
fail
"Replicas not replicating from master"
}
}
...
...
tests/integration/psync2.tcl
View file @
ea63aea7
...
@@ -67,6 +67,16 @@ start_server {} {
...
@@ -67,6 +67,16 @@ start_server {} {
lappend used $slave_id
lappend used $slave_id
}
}
# Wait for replicas to sync. so next loop won't get -LOADING error
wait_for_condition 50 1000
{
[
status $R
([
expr
{(
$master
_id+1
)
%5
}])
master_link_status
]
==
"up"
&&
[
status $R
([
expr
{(
$master
_id+2
)
%5
}])
master_link_status
]
==
"up"
&&
[
status $R
([
expr
{(
$master
_id+3
)
%5
}])
master_link_status
]
==
"up"
&&
[
status $R
([
expr
{(
$master
_id+4
)
%5
}])
master_link_status
]
==
"up"
}
else
{
fail
"Replica not reconnecting"
}
# 3) Increment the counter and wait for all the instances
# 3) Increment the counter and wait for all the instances
# to converge.
# to converge.
test
"PSYNC2: cluster is consistent after failover"
{
test
"PSYNC2: cluster is consistent after failover"
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment