mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

Kubernetes relies on the PrevKV() option in the watches it opens against etcd. This commit adds a robustness test to validate the same. A watch response returned with PrevKV() is valid if: The value in current event's prevKV matches the previous event's value of the same key if this is not a create event. There are cases where there can be a prevKV for a create event as well, for example if a watch is opened after the key is creatd. Since we don't simulate for that, we don't check for that. Further, this adjusts revision numbers such that we can successfully create a new replay. Needed now since we will have unit tests with and without PrevKV co-existing and we requite creation of a new replay everytime we validate PrevKV. We also regenerate test data with so that prevKV exists in it Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>