diff options
author | Oran Agra <oran@redislabs.com> | 2021-03-22 10:51:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-22 10:51:13 +0200 |
commit | 2f717c156a0bca757b8a8dfacf27e9cbeb60f99d (patch) | |
tree | 197daa4d64cc56a51a0ba0c4d4251d87b31d1e99 | |
parent | a7c02b19bfe8ca719995d4f3d940b1f27f7f73b8 (diff) | |
download | redis-2f717c156a0bca757b8a8dfacf27e9cbeb60f99d.tar.gz |
fix race in diskless load cluster tests (#8674)
-rw-r--r-- | tests/cluster/tests/17-diskless-load-swapdb.tcl | 9 |
1 files changed, 8 insertions, 1 deletions
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] |