summaryrefslogtreecommitdiff
path: root/tests/helpers
diff options
context:
space:
mode:
authorYaacovHazan <31382944+YaacovHazan@users.noreply.github.com>2021-05-20 15:29:43 +0300
committerGitHub <noreply@github.com>2021-05-20 15:29:43 +0300
commit32a2584e079a1b3c2d1e6649e38239381a73a459 (patch)
treeaeb9657d9c8d4a025862792776890eac05f7cbc2 /tests/helpers
parent8627751ec64e40181e3acfc53b3e2f73a3730cb7 (diff)
downloadredis-32a2584e079a1b3c2d1e6649e38239381a73a459.tar.gz
stabilize tests that involved with load handlers (#8967)
When test stop 'load handler' by killing the process that generating the load, some commands that already in the input buffer, still might be processed by the server. This may cause some instability in tests, that count on that no more commands processed after we stop the `load handler' In this commit, new proc 'wait_load_handlers_disconnected' added, to verify that no more cammands from any 'load handler' prossesed, by checking that the clients who genreate the load is disconnceted. Also, replacing check of dbsize with wait_for_ofs_sync before comparing debug digest, as it would fail in case the last key the workload wrote was an overridden key (not a new one). Affected tests Race fix: - failover command to specific replica works - Connect multiple replicas at the same time (issue #141), master diskless=$mdl, replica diskless=$sdl - AOF rewrite during write load: RDB preamble=$rdbpre Cleanup and speedup: - Test replication with blocking lists and sorted sets operations - Test replication with parallel clients writing in different DBs - Test replication partial resync: $descr (diskless: $mdl, $sdl, reconnect: $reconnect
Diffstat (limited to 'tests/helpers')
-rw-r--r--tests/helpers/bg_block_op.tcl1
-rw-r--r--tests/helpers/bg_complex_data.tcl1
-rw-r--r--tests/helpers/gen_write_load.tcl1
3 files changed, 3 insertions, 0 deletions
diff --git a/tests/helpers/bg_block_op.tcl b/tests/helpers/bg_block_op.tcl
index c8b323308..dc4e1a999 100644
--- a/tests/helpers/bg_block_op.tcl
+++ b/tests/helpers/bg_block_op.tcl
@@ -12,6 +12,7 @@ set ::tlsdir "tests/tls"
# blocking.
proc bg_block_op {host port db ops tls} {
set r [redis $host $port 0 $tls]
+ $r client setname LOAD_HANDLER
$r select $db
for {set j 0} {$j < $ops} {incr j} {
diff --git a/tests/helpers/bg_complex_data.tcl b/tests/helpers/bg_complex_data.tcl
index e888748a7..9c0044e7f 100644
--- a/tests/helpers/bg_complex_data.tcl
+++ b/tests/helpers/bg_complex_data.tcl
@@ -5,6 +5,7 @@ set ::tlsdir "tests/tls"
proc bg_complex_data {host port db ops tls} {
set r [redis $host $port 0 $tls]
+ $r client setname LOAD_HANDLER
$r select $db
createComplexDataset $r $ops
}
diff --git a/tests/helpers/gen_write_load.tcl b/tests/helpers/gen_write_load.tcl
index cbf6651bd..568f5cde2 100644
--- a/tests/helpers/gen_write_load.tcl
+++ b/tests/helpers/gen_write_load.tcl
@@ -5,6 +5,7 @@ set ::tlsdir "tests/tls"
proc gen_write_load {host port seconds tls} {
set start_time [clock seconds]
set r [redis $host $port 1 $tls]
+ $r client setname LOAD_HANDLER
$r select 9
while 1 {
$r set [expr rand()] [expr rand()]