summaryrefslogtreecommitdiff
path: root/tests/integration/replication-4.tcl
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/integration/replication-4.tcl
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/integration/replication-4.tcl')
-rw-r--r--tests/integration/replication-4.tcl17
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/integration/replication-4.tcl b/tests/integration/replication-4.tcl
index 8715ae999..e4ac83e12 100644
--- a/tests/integration/replication-4.tcl
+++ b/tests/integration/replication-4.tcl
@@ -21,15 +21,9 @@ start_server {tags {"repl network"}} {
stop_bg_complex_data $load_handle0
stop_bg_complex_data $load_handle1
stop_bg_complex_data $load_handle2
- set retry 10
- while {$retry && ([$master debug digest] ne [$slave debug digest])}\
- {
- after 1000
- incr retry -1
- }
- assert {[$master dbsize] > 0}
-
- if {[$master debug digest] ne [$slave debug digest]} {
+ wait_for_condition 100 100 {
+ [$master debug digest] == [$slave debug digest]
+ } else {
set csv1 [csvdump r]
set csv2 [csvdump {r -1}]
set fd [open /tmp/repldump1.txt w]
@@ -38,10 +32,9 @@ start_server {tags {"repl network"}} {
set fd [open /tmp/repldump2.txt w]
puts -nonewline $fd $csv2
close $fd
- puts "Master - Replica inconsistency"
- puts "Run diff -u against /tmp/repldump*.txt for more info"
+ fail "Master - Replica inconsistency, Run diff -u against /tmp/repldump*.txt for more info"
}
- assert_equal [r debug digest] [r -1 debug digest]
+ assert {[$master dbsize] > 0}
}
}
}