summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2023-04-18 21:14:26 +0800
committerGitHub <noreply@github.com>2023-04-18 16:14:26 +0300
commit20533cc1d7684e3ffc8c74bbd6725e4189de6939 (patch)
treed9b04973990a412024680d7648c915f4e7623bef /tests/integration
parent42c8c61813a8c3287b8acb3155473551a491aa2b (diff)
downloadredis-20533cc1d7684e3ffc8c74bbd6725e4189de6939.tar.gz
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 <guy.benoish@redislabs.com>
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/psync2-master-restart.tcl3
-rw-r--r--tests/integration/psync2.tcl2
-rw-r--r--tests/integration/rdb.tcl5
3 files changed, 9 insertions, 1 deletions
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