From 722fd729e62b717e705e0eb4c79254e2cf329a9f Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Mon, 22 Mar 2021 10:51:13 +0200 Subject: [PATCH] fix race in diskless load cluster tests (#8674) --- tests/cluster/tests/17-diskless-load-swapdb.tcl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/cluster/tests/17-diskless-load-swapdb.tcl b/tests/cluster/tests/17-diskless-load-swapdb.tcl index 612818cb7..516e5170c 100644 --- a/tests/cluster/tests/17-diskless-load-swapdb.tcl +++ b/tests/cluster/tests/17-diskless-load-swapdb.tcl @@ -36,7 +36,7 @@ test "Right to restore backups when fail to diskless load " { # Write a key that belongs to slot 0 set slot0_key "06S" $master set $slot0_key 1 - after 100 + wait_for_ofs_sync $master $replica assert_equal {1} [$replica get $slot0_key] assert_equal $slot0_key [$replica CLUSTER GETKEYSINSLOT 0 1] @@ -73,6 +73,13 @@ test "Right to restore backups when fail to diskless load " { # Kill master, abort full sync kill_instance redis $master_id + # Start full sync, wait till the replica detects the disconnection + wait_for_condition 500 10 { + [s $replica_id loading] eq 0 + } else { + fail "Fail to full sync" + } + # Replica keys and keys to slots map still both are right assert_equal {1} [$replica get $slot0_key] assert_equal $slot0_key [$replica CLUSTER GETKEYSINSLOT 0 1]