summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-12-22 20:23:14 +0800
committerGitHub <noreply@github.com>2022-12-22 14:23:14 +0200
commit9e1a00d663c9212e6e992feb690089a5eac686f3 (patch)
tree4b29781eb8fbbce574e7e8941a217f9dce0aab5a /tests/integration
parent9b20d598a5942aea31eb3b042a551b8d05eacccf (diff)
downloadredis-9e1a00d663c9212e6e992feb690089a5eac686f3.tar.gz
Fix race in PSYNC2 partial resync test (#11653)
This test sometimes fails: ``` *** [err]: PSYNC2: Partial resync after Master restart using RDB aux fields with expire in tests/integration/psync2-master-restart.tcl Expected [status ::redis::redisHandle24 sync_partial_ok] == 1 (context: type eval line 49 cmd {assert {[status $replica sync_partial_ok] == 1}} proc ::test) ``` This is because the default repl-timeout value is 10s, sometimes the test got timeout, then it will do a reconnect, it will incr the sync_partial_ok counter, and then cause the test to fail.In this fix, we set the repl-timeout to a very large number to make sure we won't get the timeout.
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/psync2-master-restart.tcl7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/integration/psync2-master-restart.tcl b/tests/integration/psync2-master-restart.tcl
index c0c8f471f..03470bf81 100644
--- a/tests/integration/psync2-master-restart.tcl
+++ b/tests/integration/psync2-master-restart.tcl
@@ -11,6 +11,13 @@ start_server {} {
set sub_replica [srv -2 client]
+ # 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
+ $master config set repl-timeout 3600
+ $replica config set repl-timeout 3600
+ $sub_replica config set repl-timeout 3600
+
# Build replication chain
$replica replicaof $master_host $master_port
$sub_replica replicaof $replica_host $replica_port