From 7a3cb3b4b37419b84fa13c51bbaba3f8bea44838 Mon Sep 17 00:00:00 2001 From: Yuan Wang Date: Wed, 19 Nov 2025 17:10:57 +0800 Subject: [PATCH] Fix CI flaky tests (#14531) - https://github.com/redis/redis/actions/runs/19200504999/job/54887625884 avoid calling `start_write_load` before pausing the destination node - https://github.com/redis/redis/actions/runs/18958533020/job/54140746904 maybe the replica did not sync with master, then the replica did not update the counter --- tests/unit/cluster/atomic-slot-migration.tcl | 8 ++++---- tests/unit/moduleapi/cluster.tcl | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/unit/cluster/atomic-slot-migration.tcl b/tests/unit/cluster/atomic-slot-migration.tcl index 762c339a8..27ea79bd8 100644 --- a/tests/unit/cluster/atomic-slot-migration.tcl +++ b/tests/unit/cluster/atomic-slot-migration.tcl @@ -1342,12 +1342,9 @@ start_cluster 3 3 {tags {external:skip cluster} overrides {cluster-node-timeout # start migration from #0 to #1 set task_id [setup_slot_migration_with_delay 0 1 0 100] - # Create some traffic on slot 0, so the destination node will enter streaming buffer state + # Create 200 keys of 16k size traffic on slot 0, streaming buffer need 10s (200*50ms) populate_slot 200 -idx 0 -slot 0 -size 16384 - # Start the slot 0 write load on the R 0 - set load_handle [start_write_load "127.0.0.1" [get_port 0] 100 [slot_key 0 mykey] 500] - # wait for streaming buffer state, then pause the destination node wait_for_condition 1000 20 { [string match {*streaming-buffer*} [migration_status 1 $task_id state]] @@ -1356,6 +1353,9 @@ start_cluster 3 3 {tags {external:skip cluster} overrides {cluster-node-timeout } pause_process $r1_pid + # Start the slot 0 write load on the R 0 + set load_handle [start_write_load "127.0.0.1" [get_port 0] 100 [slot_key 0 mykey] 500] + # the source node will fail after several seconds (including the time # to fill the socket buffer of source node), the main channel can not # write data to destination since the destination is paused diff --git a/tests/unit/moduleapi/cluster.tcl b/tests/unit/moduleapi/cluster.tcl index d79dd664d..7141fe1d5 100644 --- a/tests/unit/moduleapi/cluster.tcl +++ b/tests/unit/moduleapi/cluster.tcl @@ -177,6 +177,7 @@ start_cluster 2 2 [list tags {external:skip cluster modules} config_lines $modul $master2 set count_dels_{4oi} 1 $master2 del count_dels_{4oi} assert_equal 1 [$master2 keyspace.get_dels] + wait_for_ofs_sync $master2 $replica2 assert_equal 1 [$replica2 keyspace.get_dels] $master2 set count_dels_{4oi} 1