Stabilize bgsave test that sometimes fails with valgrind (#7559)
on ci.redis.io the test fails a lot, reporting that bgsave didn't end. increaseing the timeout we wait for that bgsave to get aborted. in addition to that, i also verify that it indeed got aborted by checking that the save counter wasn't reset. add another test to verify that a successful bgsave indeed resets the change counter.
This commit is contained in:
parent
8d82639319
commit
8a57969fd7
@ -118,16 +118,34 @@ start_server_and_kill_it [list "dir" $server_path] {
|
|||||||
|
|
||||||
start_server {} {
|
start_server {} {
|
||||||
test {Test FLUSHALL aborts bgsave} {
|
test {Test FLUSHALL aborts bgsave} {
|
||||||
|
# 1000 keys with 1ms sleep per key shuld take 1 second
|
||||||
r config set rdb-key-save-delay 1000
|
r config set rdb-key-save-delay 1000
|
||||||
r debug populate 1000
|
r debug populate 1000
|
||||||
r bgsave
|
r bgsave
|
||||||
assert_equal [s rdb_bgsave_in_progress] 1
|
assert_equal [s rdb_bgsave_in_progress] 1
|
||||||
r flushall
|
r flushall
|
||||||
after 200
|
# wait half a second max
|
||||||
assert_equal [s rdb_bgsave_in_progress] 0
|
wait_for_condition 5 100 {
|
||||||
|
[s rdb_bgsave_in_progress] == 0
|
||||||
|
} else {
|
||||||
|
fail "bgsave not aborted"
|
||||||
|
}
|
||||||
|
# veirfy that bgsave failed, by checking that the change counter is still high
|
||||||
|
assert_lessthan 999 [s rdb_changes_since_last_save]
|
||||||
# make sure the server is still writable
|
# make sure the server is still writable
|
||||||
r set x xx
|
r set x xx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test {bgsave resets the change counter} {
|
||||||
|
r config set rdb-key-save-delay 0
|
||||||
|
r bgsave
|
||||||
|
wait_for_condition 5 100 {
|
||||||
|
[s rdb_bgsave_in_progress] == 0
|
||||||
|
} else {
|
||||||
|
fail "bgsave not aborted"
|
||||||
|
}
|
||||||
|
assert_equal [s rdb_changes_since_last_save] 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test {client freed during loading} {
|
test {client freed during loading} {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user