Skip to content

Commit

Permalink
Fix timing issue in the module propagate test
Browse files Browse the repository at this point in the history
There is a timing issue in the test:
```
*** [err]: module RM_Call of expired key propagation in tests/unit/moduleapi/propagate.tcl
Expected '1' to be equal to '2' (context: type eval line 27 cmd {assert_equal [$replica propagate-test.obeyed] 2} proc ::test)
```

We should wait for sync, otherwise the replica may not be fully
synchronized before checking. The test was introduced in valkey-io#1582.

Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Mar 4, 2025
1 parent 7a2d50a commit b42863c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/unit/moduleapi/propagate.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,13 @@ tags "modules" {

assert_equal [$master get k1] 1
assert_equal [$master ttl k1] -1
wait_for_ofs_sync $master $replica
assert_equal [$replica get k1] 1
assert_equal [$replica ttl k1] -1
# Validate that replicated commands were "obeyed" from primary.
assert_equal [$replica propagate-test.obeyed] 1
$master propagate-test.incr k1
wait_for_ofs_sync $master $replica
assert_equal [$replica propagate-test.obeyed] 2
}

Expand Down

0 comments on commit b42863c

Please sign in to comment.