From bf74b95a3c6219b800e50b2cc3eee5d2356460a4 Mon Sep 17 00:00:00 2001 From: Hanxi Zhang Date: Wed, 20 Aug 2025 00:43:09 +0000 Subject: [PATCH 1/2] Fix potential race condition in cluster module test Signed-off-by: Hanxi Zhang --- tests/unit/moduleapi/cluster.tcl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/moduleapi/cluster.tcl b/tests/unit/moduleapi/cluster.tcl index b6ac1a9fcdd..f83bf6aa3c4 100644 --- a/tests/unit/moduleapi/cluster.tcl +++ b/tests/unit/moduleapi/cluster.tcl @@ -31,7 +31,11 @@ start_cluster 3 0 [list config_lines $modules] { } else { fail "node 1 didn't receive DONG messages" } - assert_equal 2 [count_log_message 0 "* DONG (type 2) RECEIVED*"] + wait_for_condition 50 100 { + [count_log_message 0 "* DONG (type 2) RECEIVED*"] eq 2 + } else { + fail "node 1 didn't log 2 DONG messages" + } } } From d6218aa77a5c29b56a20b1011927dd58efe66a1c Mon Sep 17 00:00:00 2001 From: Hanxi Zhang Date: Thu, 21 Aug 2025 10:26:30 -0700 Subject: [PATCH 2/2] Update tests/unit/moduleapi/cluster.tcl Co-authored-by: Harkrishn Patro Signed-off-by: Hanxi Zhang --- tests/unit/moduleapi/cluster.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/moduleapi/cluster.tcl b/tests/unit/moduleapi/cluster.tcl index f83bf6aa3c4..0ad054e2f08 100644 --- a/tests/unit/moduleapi/cluster.tcl +++ b/tests/unit/moduleapi/cluster.tcl @@ -34,7 +34,7 @@ start_cluster 3 0 [list config_lines $modules] { wait_for_condition 50 100 { [count_log_message 0 "* DONG (type 2) RECEIVED*"] eq 2 } else { - fail "node 1 didn't log 2 DONG messages" + fail "node 1 didn't log DONG message twice" } } }