44 Commits

Author SHA1 Message Date
Marek Siarkowicz
5a8c8b703b
Merge pull request #17807 from serathius/robustness-resumable-revision-zero
Resumable handles watch with revision zero
2024-04-16 19:41:53 +02:00
Marek Siarkowicz
dc187ce6e8 Validate bookmarkable checks the last event before progress notify
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-16 09:17:40 +02:00
Marek Siarkowicz
94a47a7cbd Resumable handles watch with revision zero
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-15 20:23:51 +02:00
Marek Siarkowicz
042e7d1a0c Add filter validation to ensure watch only includes events within selector
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-15 20:05:08 +02:00
Marek Siarkowicz
a95a307698 Add tests to watch validation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-14 21:38:03 +02:00
Marek Siarkowicz
569693be8d Utilize WAL to patch operation history
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-14 12:09:38 +02:00
Marek Siarkowicz
f8de338ab2 Add explicit checks for assumptions in robustness test validation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-12 14:18:22 +02:00
Marek Siarkowicz
718d5ba2b4 Calculate request success rate to provide signal to performance debugging
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-11 09:36:17 +02:00
Marek Siarkowicz
6cb4c3f90d Document re-evaluating existing robustness test reports
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-08 16:58:12 +02:00
Marek Siarkowicz
e2bb8c698f Limit a timeout in testing robustness validation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-04-06 12:28:57 +02:00
Ivan Valdes
0976398964
tests/robustness: address golangci var-naming issues
Signed-off-by: Ivan Valdes <ivan@vald.es>
2024-03-25 16:27:05 -07:00
thirdkeyword
fbda591866 fix some typos
Signed-off-by: thirdkeyword <fliterdashen@gmail.com>
2024-03-25 10:34:44 +08:00
Marek Siarkowicz
3a351c2fec Revert "tests/robustness: check for compaction before prevKV validation"
This reverts commit 5d7f58d14be1da5135d158dad6fc43391cbf6283.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-02-21 16:15:40 +01:00
Madhav Jivrajani
5d7f58d14b tests/robustness: check for compaction before prevKV validation
We can check for the condition that Kubernetes checks for, i.e.
prevKV can be nil iff the event is not a create a event, only if
we know whether compaction has occured or not. If compaction has
occured, prevKV can be nil and that is completely valid.

This commit checks if compaction took place during the test run
by querying the /metrics endpoint. Based on if compaction occured,
we now check the Kubernetes condition in the prevKV robustness test.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2024-02-19 17:05:59 +05:30
Madhav Jivrajani
cdd018ad2a tests/robustness: add a robustness test for validating create events
Split off valdiating create events from the prevKV test.
The added test tests the following two:
- A create event should not exist in our past history
- A non-create event should exist in our past history

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2024-02-14 16:28:44 +05:30
Madhav Jivrajani
4fa07a1c8a tests/robustness: make merging histories work on []PersistedEvent
Event histories after merging serve as an authorotative list of
events that can be seen as ones persisted by etcd, we don't need
PrevValue as part of it.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2024-02-14 15:44:08 +05:30
Madhav Jivrajani
9aad6700d5 tests/robustness: add robustness test for watch with PrevKV()
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>
2024-02-13 22:55:57 +05:30
Marek Siarkowicz
c37991cf8b Validate watch even if event history cannot be created
Creation of event history requires each client to return consistent
events. If clients observed inconsistent view of some revision, merging
will fail and return diff between two clients. This however doesn't
provide hint on what kind of issue happend.

This PR helps cases where there is an error with single watch
stream (like event duplication) by running normal watch validation even
without full event history.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-01-16 16:04:03 +01:00
Wei Fu
aea1cd0077 feat: enable unparam lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-17 21:24:13 +08:00
Marek Siarkowicz
4791964173
Merge pull request #16757 from serathius/minimal-time
Use the minimal time event was observed on watch
2023-10-16 11:25:30 +02:00
Marek Siarkowicz
841731bbf0 Fix linearization failure not causing test failure
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-13 18:56:22 +02:00
Marek Siarkowicz
4c7b8dbc94 Use the minimal time event was observed on watch
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-13 18:17:29 +02:00
Marek Siarkowicz
b02798e946 Refactor and reorder validation to avoid reporting multiple corelated failures
It doesn't make sense to report watch failure if key value operations
are not linearizable.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-13 14:06:13 +02:00
Marek Siarkowicz
c2655b4112 Fix watch validation assuming that client requesting older watch revision
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-10-05 14:09:43 +02:00
Wei Fu
07effc4d0a *: fix revive linter
Remove old revive_pass in the bash scripts and migirate the revive.toml
into golangci linter_settings.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-24 14:21:11 +08:00
Wei Fu
aa97484166 *: enable goimports in verify-lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-21 21:14:09 +08:00
Benjamin Wang
700411d838
Merge pull request #16601 from fuweid/fix-nakedret-lint
*: fix nakedret lint
2023-09-18 10:00:25 +01:00
Wei Fu
e72c2c40d4 *: fix nakedret lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-17 23:52:41 +08:00
chenyahui
c0aa3b613b Use any instead of interface{}
Signed-off-by: chenyahui <cyhone@qq.com>
2023-09-17 17:41:58 +08:00
Marek Siarkowicz
11da84a1d1 tests/robustness: Implement loading client reports
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-28 15:35:17 +02:00
Marek Siarkowicz
09c462e2ea tests/robustness: Add resumable validation and improve reliable validation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-26 12:12:39 +02:00
Marek Siarkowicz
26cd2bc017 tests/robustness: Store whole watch operations
Want to keep watch requests to properly validate reliability of watch
stream.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-24 18:15:50 +02:00
Marek Siarkowicz
31b20ef40f
Merge pull request #16129 from serathius/robustness-fix-patch-txn-onfailure
Robustness fix patch txn onfailure
2023-06-24 17:32:31 +02:00
Marek Siarkowicz
1f6e1102a2 tests/robustness: Fix operation patching for txn with onFailure operations
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-24 11:20:12 +02:00
Marek Siarkowicz
0ae8f26f06 tests/robustness: Refactor patch operation functions
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-24 11:19:24 +02:00
Marek Siarkowicz
78ca04a94a tests/robustness: Combine watch histories
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-23 18:40:07 +02:00
Marek Siarkowicz
f7831e2607 tests/robustness: Move key into dedicated options to allow to implement proper ranges
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-22 18:27:54 +02:00
Marek Siarkowicz
3f09a51c60 tests/robustness: Make watch event independent from etcd operation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-22 15:43:27 +02:00
Marek Siarkowicz
1663600bec tests/robustness: Validate stale get requests by replaying etcd state
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-19 14:17:38 +02:00
Marek Siarkowicz
96987d8b5e tests/robustness: Implement stale reads without validation
For now we just validate stale read revision, but not response content.
Reason is that etcd model only stores latest version of keys, and no
history like real etcd.

Validating stale read contents needs to be done outside of model
as storing whole history is just to costly for linearization validation.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-16 21:17:37 +02:00
Marek Siarkowicz
34cbf4cd6f tests/robustness: Allow errors and unknown responses in deterministic model
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-15 22:25:48 +02:00
Marek Siarkowicz
6979318108 tests/robustness: Make Range a proper request type to allow setting Range.Revision != 0 for stale reads
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-14 13:55:45 +02:00
Marek Siarkowicz
974655e02c tests/robustness: Rename operations const to separate from RequestType
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-14 13:24:14 +02:00
Marek Siarkowicz
7bbc738ec4 tests/robustness: Extract validation to separate package
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-06-14 09:14:27 +02:00