mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
Merge pull request #5549 from oranagra/fix_test_races
fix small test suite race conditions
This commit is contained in:
commit
46a51cdcdc
@ -91,6 +91,14 @@ proc wait_for_sync r {
|
||||
}
|
||||
}
|
||||
|
||||
proc wait_for_ofs_sync {r1 r2} {
|
||||
wait_for_condition 50 100 {
|
||||
[status $r1 master_repl_offset] eq [status $r2 master_repl_offset]
|
||||
} else {
|
||||
fail "replica didn't sync in time"
|
||||
}
|
||||
}
|
||||
|
||||
# Random integer between 0 and max (excluded).
|
||||
proc randomInt {max} {
|
||||
expr {int(rand()*$max)}
|
||||
|
@ -90,6 +90,7 @@ start_server {tags {"defrag"}} {
|
||||
test "Active defrag big keys" {
|
||||
r flushdb
|
||||
r config resetstat
|
||||
r config set save "" ;# prevent bgsave from interfereing with save below
|
||||
r config set activedefrag no
|
||||
r config set active-defrag-max-scan-fields 1000
|
||||
r config set active-defrag-threshold-lower 5
|
||||
|
@ -231,6 +231,8 @@ start_server {
|
||||
}
|
||||
}
|
||||
|
||||
wait_for_ofs_sync $master $slave
|
||||
|
||||
# Turn slave into master
|
||||
$slave slaveof no one
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user