From 20533cc1d7684e3ffc8c74bbd6725e4189de6939 Mon Sep 17 00:00:00 2001 From: Binbin Date: Tue, 18 Apr 2023 21:14:26 +0800 Subject: Tests: Do not save an RDB by default and add a SIGTERM default AOFRW test (#12064) In order to speed up tests, avoid saving an RDB (mostly notable on shutdown), except for tests that explicitly test the RDB mechanism In addition, use `shutdown-on-sigterm force` to prevetn shutdown from failing in case the server is in the middle of the initial AOFRW Also a a test that checks that the `shutdown-on-sigterm default` is to refuse shutdown if there's an initial AOFRW Co-authored-by: Guy Benoish --- tests/integration/psync2-master-restart.tcl | 3 +++ tests/integration/psync2.tcl | 2 ++ tests/integration/rdb.tcl | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/integration') diff --git a/tests/integration/psync2-master-restart.tcl b/tests/integration/psync2-master-restart.tcl index 03470bf81..e925aaab8 100644 --- a/tests/integration/psync2-master-restart.tcl +++ b/tests/integration/psync2-master-restart.tcl @@ -11,6 +11,9 @@ start_server {} { set sub_replica [srv -2 client] + # Make sure the server saves an RDB on shutdown + $master config set save "3600 1" + # Because we will test partial resync later, we don’t want a timeout to cause # the master-replica disconnect, then the extra reconnections will break the # sync_partial_ok stat test diff --git a/tests/integration/psync2.tcl b/tests/integration/psync2.tcl index a258f1b83..4abe059b1 100644 --- a/tests/integration/psync2.tcl +++ b/tests/integration/psync2.tcl @@ -355,6 +355,8 @@ start_server {} { set sync_partial [status $R($master_id) sync_partial_ok] set sync_partial_err [status $R($master_id) sync_partial_err] catch { + # Make sure the server saves an RDB on shutdown + $R($slave_id) config set save "900 1" $R($slave_id) config rewrite restart_server [expr {0-$slave_id}] true false set R($slave_id) [srv [expr {0-$slave_id}] client] diff --git a/tests/integration/rdb.tcl b/tests/integration/rdb.tcl index 2362ef079..cce21671f 100644 --- a/tests/integration/rdb.tcl +++ b/tests/integration/rdb.tcl @@ -173,7 +173,7 @@ start_server {} { } test {client freed during loading} { - start_server [list overrides [list key-load-delay 50 loading-process-events-interval-bytes 1024 rdbcompression no]] { + start_server [list overrides [list key-load-delay 50 loading-process-events-interval-bytes 1024 rdbcompression no save "900 1"]] { # create a big rdb that will take long to load. it is important # for keys to be big since the server processes events only once in 2mb. # 100mb of rdb, 100k keys will load in more than 5 seconds @@ -370,6 +370,9 @@ start_server [list overrides [list "dir" $server_path "dbfilename" "scriptbackup start_server {} { test "failed bgsave prevents writes" { + # Make sure the server saves an RDB on shutdown + r config set save "900 1" + r config set rdb-key-save-delay 10000000 populate 1000 r set x x -- cgit v1.2.1