Fix failing test due to recent change in transaction propagation (#10006)

PR #9890 may have introduced a problem.
There are tests that use MULTI-EXEC to make sure two BGSAVE / BGREWRITEAOF are executed together.
But now it's not valid to run run commands that create a snapshot inside a transaction (gonna be blocked soon)
This PR modifies the test not to rely on MULTI-EXEC.

Co-authored-by: Oran Agra <oran@redislabs.com>
This commit is contained in:
chenyang8094 2021-12-27 21:18:17 +08:00 committed by GitHub
parent 0f15e025e6
commit 317464a386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,28 +179,28 @@ start_server {tags {"aofrw external:skip"} overrides {aof-use-rdb-preamble no}}
}
test {BGREWRITEAOF is delayed if BGSAVE is in progress} {
r multi
r flushall
r set k v
r config set rdb-key-save-delay 10000000
r bgsave
r bgrewriteaof
r info persistence
set res [r exec]
assert_match {*scheduled*} [lindex $res 1]
assert_match {*aof_rewrite_scheduled:1*} [lindex $res 2]
while {[string match {*aof_rewrite_scheduled:1*} [r info persistence]]} {
assert_match {*scheduled*} [r bgrewriteaof]
assert_equal [s aof_rewrite_scheduled] 1
r config set rdb-key-save-delay 0
catch {exec kill -9 [get_child_pid 0]}
while {[s aof_rewrite_scheduled] eq 1} {
after 100
}
}
test {BGREWRITEAOF is refused if already in progress} {
r config set aof-use-rdb-preamble yes
r config set rdb-key-save-delay 10000000
catch {
r multi
r bgrewriteaof
r bgrewriteaof
r exec
} e
assert_match {*ERR*already*} $e
while {[string match {*aof_rewrite_scheduled:1*} [r info persistence]]} {
after 100
}
r config set rdb-key-save-delay 0
catch {exec kill -9 [get_child_pid 0]}
}
}