From 3d9c427f8c017c62e3e62883c4dfe599f060f104 Mon Sep 17 00:00:00 2001 From: Binbin Date: Sun, 19 Nov 2023 17:09:33 +0800 Subject: [PATCH] Fix timing issue in CLUSTER SLAVE / REPLICAS consistent test (#12774) CI reports that this test failed, the reason is because during the command processing, the node processed PING/PONG, resulting in ping_sent or pong_received mismatch. Change to use MULTI to avoid timing issue. The test was introduced in #12224. --- tests/cluster/tests/05-slave-selection.tcl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/cluster/tests/05-slave-selection.tcl b/tests/cluster/tests/05-slave-selection.tcl index bdb20a3b7..c6b48880c 100644 --- a/tests/cluster/tests/05-slave-selection.tcl +++ b/tests/cluster/tests/05-slave-selection.tcl @@ -25,8 +25,11 @@ test "The first master has actually two slaves" { test "CLUSTER SLAVES and CLUSTER REPLICAS output is consistent" { # Because we already have command output that cover CLUSTER REPLICAS elsewhere, # here we simply judge whether their output is consistent to cover CLUSTER SLAVES. - set res [R 0 cluster slaves [R 0 CLUSTER MYID]] - set res2 [R 0 cluster replicas [R 0 CLUSTER MYID]] + set myid [R 0 CLUSTER MYID] + R 0 multi + R 0 cluster slaves $myid + R 0 cluster replicas $myid + lassign [R 0 exec] res res2 assert_equal $res $res2 }