Fix replication on expired key test timing issue, give it more chances#11548
Conversation
In replica, the key expired before master's `INCR` was arrived, so INCR
creates a new key in the replica and the test failed.
```
*** [err]: Replication of an expired key does not delete the expired key in tests/integration/replication-4.tcl
Expected '0' to be equal to '1' (context: type eval line 13 cmd {assert_equal 0 [$slave exists k]} proc ::test)
```
This test is very likely to do a false positive if the `wait_for_ofs_sync`
takes longer than the expiration time, so give it a few more chances.
The test was introduced in redis#9572.
|
First reported at #9572 (review) |
|
I guess there is no way to make it pass every time, so retrying the test case 10 times sounds good. How about increasing the TTL of k, would that make it fail less often? |
i guess it will, but then we also need to increase the time of after, so I think a simple retry can make it work better |
|
thank you for taking care of this. i think that if we bother to fix it, maybe instead of 10 retries of 1 second (which could still repeatedly fail on a slow system), i'd rather go with 5 retries of increasing timeout. |
#11548) In replica, the key expired before master's `INCR` was arrived, so INCR creates a new key in the replica and the test failed. ``` *** [err]: Replication of an expired key does not delete the expired key in tests/integration/replication-4.tcl Expected '0' to be equal to '1' (context: type eval line 13 cmd {assert_equal 0 [$slave exists k]} proc ::test) ``` This test is very likely to do a false positive if the `wait_for_ofs_sync` takes longer than the expiration time, so give it a few more chances. The test was introduced in #9572. (cherry picked from commit 06b577a)
redis#11548) In replica, the key expired before master's `INCR` was arrived, so INCR creates a new key in the replica and the test failed. ``` *** [err]: Replication of an expired key does not delete the expired key in tests/integration/replication-4.tcl Expected '0' to be equal to '1' (context: type eval line 13 cmd {assert_equal 0 [$slave exists k]} proc ::test) ``` This test is very likely to do a false positive if the `wait_for_ofs_sync` takes longer than the expiration time, so give it a few more chances. The test was introduced in redis#9572.
redis#11548) In replica, the key expired before master's `INCR` was arrived, so INCR creates a new key in the replica and the test failed. ``` *** [err]: Replication of an expired key does not delete the expired key in tests/integration/replication-4.tcl Expected '0' to be equal to '1' (context: type eval line 13 cmd {assert_equal 0 [$slave exists k]} proc ::test) ``` This test is very likely to do a false positive if the `wait_for_ofs_sync` takes longer than the expiration time, so give it a few more chances. The test was introduced in redis#9572.
In replica, the key expired before master's
INCRwas arrived, so INCRcreates a new key in the replica and the test failed.
This test is very likely to do a false positive if the
wait_for_ofs_synctakes longer than the expiration time, so give it a few more chances.
Go with 5 retries of increasing timeout, i.e. start with 500ms, then go
to 1000ms, 2000ms, 4000ms, 8000ms.
The test was introduced in #9572
Also it fixes #11153