From 83792d0471b6e9a431c57ff34bbc7ec6bea73435 Mon Sep 17 00:00:00 2001 From: Yanqi Lv Date: Tue, 10 Dec 2024 09:08:14 +0800 Subject: [PATCH] Update tests/unit/expire.tcl Co-authored-by: Binbin Signed-off-by: Yanqi Lv --- tests/unit/expire.tcl | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/unit/expire.tcl b/tests/unit/expire.tcl index 18410b45dc..c5c11191c0 100644 --- a/tests/unit/expire.tcl +++ b/tests/unit/expire.tcl @@ -834,21 +834,16 @@ start_server {tags {"expire"}} { } {} {needs:debug} test {import-source can be closed when import-mode is off} { - r flushall - set id [r client id] - - catch {r client import-source on} err - assert_match {ERR*} $err + r config set import-mode no + assert_error "ERR Server is not in import mode" {r client import-source on} r config set import-mode yes assert_equal [r client import-source on] {OK} - - assert_match {*flags=I*} [r client list id $id] + assert_match {*flags=I*} [r client list id [r client id]] r config set import-mode no assert_equal [r client import-source off] {OK} - - assert_match {*flags=N*} [r client list id $id] + assert_match {*flags=N*} [r client list id [r client id]] } test {Import mode should forbid active expiration} {