diff --git a/tests/unit/aofrw.tcl b/tests/unit/aofrw.tcl index 8d373882e..92bef5f91 100644 --- a/tests/unit/aofrw.tcl +++ b/tests/unit/aofrw.tcl @@ -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]} } }