New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve reliability of kvstore-related tests #26347
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
giorio94
added
kind/bug/CI
This is a bug in the testing code.
area/clustermesh
Relates to multi-cluster routing functionality in Cilium.
release-note/misc
This PR makes changes that have no direct user impact.
sig/kvstore
Impacts the KVStore package interactions.
labels
Jun 19, 2023
/test |
Currently, the kvstore GetSet test repeats the same set of operations for 256 times. Yet, due to the rate limiting settings (i.e., 20 QPS), this ends up requiring quite a lot of time in the etcd case. Hence, let's reduce the number of iterations to 8, to speed up the test execution, given that the overall coverage would not be affected. Before: --- PASS: Test/EtcdSuite/TestGetSet (101.76s) After: --- PASS: Test/EtcdSuite/TestGetSet (2.55s) Additionally, this commit updates one of the checks that was identical to another performed immediately before. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
In view of the subsequent commit that will introduce a locking mechanism to prevent the execution of two kvstore tests in parallel, we need to refactor the EtcdRateLimiter test to avoid initializing two clients during the same test (as it would lead to a deadlock). While being at it, let's also convert it to leverage the testing framework. No functional differences are expected to be introduced by this refactoring. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Multiple tests might be running in parallel by go test if they are part of different packages. This can lead to race conditions and tests flakiness if different tests touch the same keys. Hence, let's add a locking mechanism to the client initialization logic used in tests to prevent that two clients are created in parallel. Additionally, let's automatically register the appropriate cleanup logic to delete all keys and close the client when the test terminates. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Now that a locking mechanism is in place to prevent the interaction between different tests using the kvstore, let's enable again the kvstoremesh integration tests. Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
giorio94
force-pushed
the
mio/kvstore-tests
branch
from
June 19, 2023 10:15
2d42d2b
to
a0da2b9
Compare
/test |
tklauser
approved these changes
Jun 19, 2023
jrajahalme
approved these changes
Jun 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
YutaroHayakawa
approved these changes
Jun 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
borkmann
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Jun 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/clustermesh
Relates to multi-cluster routing functionality in Cilium.
kind/bug/CI
This is a bug in the testing code.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-note/misc
This PR makes changes that have no direct user impact.
sig/kvstore
Impacts the KVStore package interactions.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a set of changes to improve the reliability of the kvstore-related tests, in particular preventing that multiple tests can operate on the same kvstore in parallel. Please refer to the individual commit messages for additional details.