mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
Test: hopefully more robust PSYNC test.
This is supposed to fix issue #1417, but we'll know if this is enough only after a couple of runs of the CI test without false positives.
This commit is contained in:
parent
f86798ba6b
commit
e7887e6060
@ -29,15 +29,25 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
|
|||||||
set load_handle1 [start_bg_complex_data $master_host $master_port 11 100000]
|
set load_handle1 [start_bg_complex_data $master_host $master_port 11 100000]
|
||||||
set load_handle2 [start_bg_complex_data $master_host $master_port 12 100000]
|
set load_handle2 [start_bg_complex_data $master_host $master_port 12 100000]
|
||||||
|
|
||||||
test {First server should have role slave after SLAVEOF} {
|
test {Slave should be able to synchronize with the master} {
|
||||||
$slave slaveof $master_host $master_port
|
$slave slaveof $master_host $master_port
|
||||||
wait_for_condition 50 100 {
|
wait_for_condition 50 100 {
|
||||||
[s 0 role] eq {slave}
|
[lindex [r role] 0] eq {slave} &&
|
||||||
|
[lindex [r role] 3] eq {connected}
|
||||||
} else {
|
} else {
|
||||||
fail "Replication not started."
|
fail "Replication not started."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check that the background clients are actually writing.
|
||||||
|
test {Detect write load to master} {
|
||||||
|
wait_for_condition 50 100 {
|
||||||
|
[$master dbsize] > 100
|
||||||
|
} else {
|
||||||
|
fail "Can't detect write load from background clients."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test "Test replication partial resync: $descr" {
|
test "Test replication partial resync: $descr" {
|
||||||
# Now while the clients are writing data, break the maste-slave
|
# Now while the clients are writing data, break the maste-slave
|
||||||
# link multiple times.
|
# link multiple times.
|
||||||
@ -92,8 +102,10 @@ test_psync {ok psync} 6 1000000 3600 0 {
|
|||||||
assert {[s -1 sync_partial_ok] > 0}
|
assert {[s -1 sync_partial_ok] > 0}
|
||||||
}
|
}
|
||||||
|
|
||||||
test_psync {no backlog} 6 100 3600 0 {
|
while 1 {
|
||||||
assert {[s -1 sync_partial_err] > 0}
|
test_psync {no backlog} 6 100 3600 0.5 {
|
||||||
|
assert {[s -1 sync_partial_err] > 0}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test_psync {ok after delay} 3 100000000 3600 3 {
|
test_psync {ok after delay} 3 100000000 3600 3 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user