kvnemesis: introduce swarm testing #150495
Draft
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 commit adds a variant of multi-node kvnemesis that uses swarm testing. The idea is that, at each step of kvnemesis, instead of choosing an operation randomly from the full set of possible operations (Get, Put, etc.), a run of kvnemesis can use a smaller subset of operations, and still choose each step randomly from that smaller set. This has been shown increase the test coverage and expose certain types of bugs within fewer test runs. Swarm testing paper: https://users.cs.utah.edu/~regehr/papers/swarm12.pdf.
For example, consider a stack implementation with Push and Pop APIs. If we always generate test cases by randomly choosing some Pushes and some Pops, it may take many test runs to generate a case where there are enough Pushes (without Pops) to reach the maximum size of the stack, and catch a potential stack overflow bug. Instead, we can generate subsets of APIs,
{Push}, {Pop}, {Push, Pop}
, and run the same randmized testing. The subset{Push}
is guaranteed to hit the stack overflow bug quickly.In kvnemesis, we have a lot of operations to choose from, so it's not feasible to generate all possible subsets. The swarm testing paper shows that generating random configurations (e.g. decide if each operation is part of the config with probability 1/2) is simple and effective in improving test coverage.
Release note: None