Commit Graph

66 Commits

Author SHA1 Message Date
Marek Siarkowicz 677aaf0c38 Fix tests to to only accesses keys from under resourcePrefix
Kubernetes-commit: 1ac067ae0e68b14a7a6eff464aacdaf7d70e838d
2025-09-03 12:23:07 +02:00
Marek Siarkowicz aa97561e5f Use increaseRV in TestWatchStreamSeparation to imply external RV increase
Kubernetes-commit: 31e035ec39e27f14d01dbe3cd466416998ba1939
2025-09-10 14:08:38 +02:00
Marek Siarkowicz d2387bc56c Inconsistency resets cache snapshots and prevents collection of new ones until cache is marked consistent again
Kubernetes-commit: 32afbd9ea5d8225fdcce7ac17afcce2f4f8cf169
2025-07-14 22:59:25 +02:00
Marek Siarkowicz 19e8aed081 Compact watch cache based on last observed etcd compaction
Kubernetes-commit: bfeaae3310fcc4c20ed3c8f2c1afebf059699e22
2025-07-10 15:17:26 +02:00
Marek Siarkowicz 2f077fcbca Add testing compaction in storage List tests
Kubernetes-commit: c53b41e98c2e9248916704f36443de87cbee64e0
2025-07-08 11:19:59 +02:00
PatrickLaabs d0ee71ec17 chore: second depr. pointer pkg replacement for apiserver
Kubernetes-commit: fe61e825e046d793d64fc0686110212dacf8231e
2025-07-06 11:09:16 +02:00
Marek Siarkowicz cf27dab482 Estimate average size of objects in etcd and plug it into request cost estimator
Kubernetes-commit: ec78b8305ad392f6faf4e5247ea33ceabb484c3f
2025-06-13 16:34:42 +02:00
Marek Siarkowicz eaf6e48501 Handle consistent LIST in watch cache to avoid incorrect semantics while setting ResourceVersion on options
Kubernetes-commit: 292679a28ae472da29c5d860afdb5c2250637d31
2025-06-06 17:16:46 +02:00
PatrickLaabs fdccb8b2dc fixing large resourceversion and limit for storages
Kubernetes-commit: ccdef28acd3a286e8d62222ddf804ae4042764e5
2025-06-18 16:22:13 +02:00
Marek Siarkowicz 9b695a5efa Validate requests sent to etcd in TestList "test List with limit" scenario
This adds a regression test to detect fallback to etcd as discovered in https://github.com/kubernetes/kubernetes/issues/132132.

Kubernetes-commit: 4cb6d3d77617f141fefd4994910380c095dac1ad
2025-06-12 11:33:02 +02:00
Davanum Srinivas 6db9ead72a Add a replacement for cmp.Diff using json+go-difflib
Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 03afe6471bdbf6462b7035fdaae5aa0dd9545396
2025-06-10 23:08:41 -04:00
Aleksander Mistewicz 7cd49caffc Add context to Count()
Passing the same context will let us associate etcd traces with those
from apiserver.

Signed-off-by: Aleksander Mistewicz <amistewicz@google.com>

Kubernetes-commit: 96b39187c5fac62e462dc348ccc1e3938464d9e1
2025-01-15 11:42:29 +01:00
Marek Siarkowicz e228aeaf39 Don't start etcd for skipped test
Kubernetes-commit: 1a15d582ae5fc84177f305d93ff473cca5de6f93
2025-03-31 21:06:54 +02:00
Marek Siarkowicz 30b60eb0a6 Fix flake, non-consistent list doesn't give any guarantees about staleness
Kubernetes-commit: 38d5cb368dd95b7f185dbba97fc3e193f48a83f2
2025-03-31 08:10:42 +02:00
Marek Siarkowicz 5a059075db Serve LISTs with exact RV and continuations from cache
Kubernetes-commit: f82c9e56d928d1028d4b298578f275a2e5e69490
2024-07-03 21:36:51 +02:00
Marek Siarkowicz c59961a007 Test continue with negative RV for reading consistent RV
Kubernetes-commit: 6d21d8f2376b6e25064b10148b4f416e8d89a508
2025-03-17 12:10:54 +01:00
Marek Siarkowicz 6f6da8e97b Add test cases for negative resource version in TestList
Kubernetes-commit: c4d77a07993302057441a886125c1c887e7869f1
2025-03-14 12:22:17 +01:00
Marek Siarkowicz 6ace22f694 Fix flaky RunTestConsistentList
Noticed that cache might not nesseserly observe the write causing test
to flake. Fixed that changing the logic to require LessOrEqual of
writeRV instead of equal to writeRV. Also added comments explaining
edge cases.

Kubernetes-commit: 86169a7a1e09c120cadafc0213afbf9630f0d8af
2025-03-14 13:45:55 +01:00
Marek Siarkowicz 4305a14262 Separate compactWatchCache from increaseRV
Kubernetes-commit: 15cb82b3b3fa95ba5b914a5a02ac01d42eda892f
2025-02-25 14:44:50 +01:00
Marek Siarkowicz 476d81d4ba Test continuations and exact revision LISTs
Kubernetes-commit: 034285dc4774f2217ca4df4626ca44b8f5f4f261
2025-02-18 17:32:41 +01:00
Marek Siarkowicz 1e6e6f0a46 Refactor TestList and validate continuations to allow testing pagination and more exact RVs in the future
Kubernetes-commit: 764e13e27aedfd9e304e6014af23f20b5619216b
2025-02-19 17:10:58 +01:00
Davanum Srinivas 0a703e3517 Linter to ensure go-cmp/cmp is used ONLY in tests
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4e05bc20db99ff89b2d2205218d24b9935a7fdd7
2025-01-24 17:03:29 -05:00
Abu Kashem fbb5ab0d70 handle watch for unsafe delete
Kubernetes-commit: 25efc8f2d136a9574166be02789ac727c5b4a3fd
2024-11-05 20:36:56 -05:00
Marek Siarkowicz 518e8ed25c Adding tests for using indexers in tests
Kubernetes-commit: 711772a1e15288d813a830780317a134df9acb5c
2024-08-22 20:04:37 +02:00
Abu Kashem 3a0975b22c refactor: add delete options for Delete method in storage interface
Kubernetes-commit: bc0ea34bc380e073a7278216fe6690a1b9aee48c
2024-09-19 10:31:08 -04:00
Marek Siarkowicz 132d3e46d6 Add paging tests
Kubernetes-commit: 99e69569808cf746262b25a9d9d515c26256c7e5
2024-07-07 16:15:47 +02:00
Lukasz Szaszkiewicz f0e44d48b8 apiserver/storage: storagetesting.RunTestList validates RemainingItemCount
Kubernetes-commit: f9b15700fb5a99ab74d51c7779ea2aae0f51168c
2024-06-27 11:01:37 +02:00
Marek Siarkowicz 2abbfffe9a Fix TestGetListRecursivePrefix for all types of LIST
Kubernetes-commit: c207f967ac3122d3a2a5ae4befdc5ada22347323
2024-06-19 10:31:37 +02:00
Marek Siarkowicz a8b9f862fb Add tests for how recursive parameter works with object prefixes
Kubernetes-commit: faa6193f34f7dac775328fbacb2f957370482024
2024-06-11 14:29:51 +02:00
Wojciech Tyczyński fd60fafe9c Deflake watchcache tests
Kubernetes-commit: 6d9edcc694415d4c1a897c4312ecd872a7f0fbf3
2024-04-29 14:26:25 +02:00
Marek Siarkowicz 67b6245fc3 Fix enabling consistent list from watch cache also works for resourceVersion=0
Kubernetes-commit: 0b8e79580eb3a63ca7707626b4894adfb9125586
2024-03-04 19:35:34 +01:00
Marek Siarkowicz 483da2032d Fix non-recursive list when consistent list from cache is enabled
Kubernetes-commit: a527cab9fce0b0234db8b4e1e95a0fc20e135df1
2024-03-04 17:59:04 +01:00
Wojciech Tyczyński 324d2bc3cf Cleanup paging parameters in etcd3 store
Kubernetes-commit: 3f4d3b67682335db510f85deb65b322127a3a0a1
2023-10-20 15:38:59 +02:00
Siyuan Zhang 77032c52b8 k8s.io/apiserver/storage: add 3 new unit tests for delete.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 26a4e06c92c248748dd3c50c74d75f8adc3c6823
2023-10-11 10:38:01 -07:00
Siyuan Zhang 70af178d56 k8s.io/apiserver/storage: add a new TestCreate case.
Add a test case of create with rv set.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 2f923e356e042d9dce88e8f78abf30f414051e71
2023-10-11 10:24:31 -07:00
Siyuan Zhang a0dede6875 k8s.io/apiserver/storage: add some ResourceVersion validation in GetList unit tests
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: baac8bb573c8efb314b037f4fbac116556c03c83
2023-10-11 10:46:30 -07:00
Lukasz Szaszkiewicz f5adfca95e storage/testing: a simple refactor
Kubernetes-commit: 39af594f312ad46715dfb705d71ad4e607e27e5d
2023-09-14 11:16:10 +02:00
Wojciech Tyczyński f56b9ee7f5 Graduate RemainingItemCount to GA
Kubernetes-commit: 4e2e059c7b205d2e4b246a262128223258a49498
2023-07-21 15:22:51 +02:00
Marek Siarkowicz df9896fd00 Test consistent List
Kubernetes-commit: b36fdd68b72cd5c64ea5be3917846067644da983
2023-07-03 17:22:22 +02:00
Wojciech Tyczyński 68a91d7597 Enable a bunch of generic storage tests for watchcache.
Kubernetes-commit: 88e2c34439016e5feddfed529698ed71e81904d9
2023-04-17 19:03:51 +02:00
Wojciech Tyczyński e4d6a4de7c Deflake TestGetListNonRecursive
Kubernetes-commit: 05f4e497f1d692031b31c27098abc1e838e8814b
2023-03-29 13:46:49 +02:00
Madhav Jivrajani abbe297fc8 storage: Get rid of TestListDeprecated
This commit extends the test cases of RunTestList
to include the things tested by TestListDeprecated
and subsequently deletes the test.

This additionally adds a test case for checking that
the list return the modified version of an object.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 7474d9b719619caa356dfb71a06482f33b3ed1ce
2023-02-15 16:54:10 +05:30
Madhav Jivrajani 5544d5836e storage/testing: Use Int64 method for pointers
Int64Ptr is now deprecated.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 1d639085eeef74ee7582a8944154a18f58d13a7b
2023-02-15 15:21:42 +05:30
Wojciech Tyczyński 8808b718c9 Explicit sorting in TestList storage test
Kubernetes-commit: 34de5fa73dabd9dcbd6f535cf6a853371ec653f1
2022-11-21 12:03:54 +01:00
Wojciech Tyczyński 299c158ba3 Reuse generic List test for watchcache
Kubernetes-commit: ef8c4fbca8e5bed1e7edc162b95c412a7f1a758e
2022-11-04 22:01:37 +01:00
Wojciech Tyczyński 8cd19efa73 Fix inconsistency in returning list results both in etcd3 and watchcache
Kubernetes-commit: da8d197a7205c01fdf376246995b0a1b3ab53859
2022-11-08 11:47:28 +01:00
Tim Allclair 3268b0561b Validate etcd paths
Kubernetes-commit: f1693a02c46f79f8c90a4ef17c4a750034f21484
2022-10-10 18:15:22 -07:00
Wojciech Tyczyński 0ed87195b0 Standardize naming in generic storage tests
Kubernetes-commit: e49c225eb9e7c428aca97e8031089e7ad91ca7c4
2022-11-05 12:14:56 +01:00
Wojciech Tyczyński 82397f8421 Fix naming in storage test setup
Kubernetes-commit: 1bc95675b19c68807ed3ae45a24701fc5c2fb935
2022-11-04 15:37:47 +01:00
Wojciech Tyczyński c51bbc3183 Parallelize tests cases in some storage tests
Kubernetes-commit: 6d85f947bf86d12e4459d31029c41d6049d40c0e
2022-11-04 10:23:40 +01:00