From 64546d20093b585143593e3728727164855fd64a Mon Sep 17 00:00:00 2001 From: "debing.sun" Date: Fri, 5 Sep 2025 14:49:19 +0800 Subject: [PATCH] Fix timing issue for sentinel master-reboot test (#14312) From the following logs, if we are in a slow environment, the election process of sentinels may become very slow. Even if the master instance that was restarted and is slowly loading RDB has already been loaded, the election just gets started. This PR makes the master load the RDB more slowly, and fixes the missing of reseting reset `key-load-delay` for the master node. --- tests/sentinel/tests/12-master-reboot.tcl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/sentinel/tests/12-master-reboot.tcl b/tests/sentinel/tests/12-master-reboot.tcl index 1fdd91d6a..5779316a3 100644 --- a/tests/sentinel/tests/12-master-reboot.tcl +++ b/tests/sentinel/tests/12-master-reboot.tcl @@ -40,7 +40,7 @@ test "Master reboot in very short time" { set addr [S 0 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster] assert {[lindex $addr 1] == $old_port} - R $master_id debug populate 10000 + R $master_id debug populate 20000 R $master_id bgsave R $master_id config set key-load-delay 1500 R $master_id config set loading-process-events-interval-bytes 1024 @@ -63,6 +63,10 @@ test "Master reboot in very short time" { } } + # Reset configuration to avoid unnecessary delays + R $master_id config set key-load-delay 0 + R $master_id config rewrite + set addr [S 0 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster] set master_id [get_instance_id_by_port redis [lindex $addr 1]]