Allow write version to jump by more than 2e9

This commit is contained in:
2024-07-03 09:07:09 -07:00
parent e59fee39c7
commit 3e6be6bd83
3 changed files with 35 additions and 22 deletions

View File

@@ -598,6 +598,7 @@ template <class ConflictSetImpl> struct TestDriver {
// Call until it returns true, for "done". Check internal invariants etc
// between calls to next.
bool next() {
assert(cs.getBytes() >= 0);
if (!arbitrary.hasEntropy()) {
return true;
}
@@ -605,7 +606,9 @@ template <class ConflictSetImpl> struct TestDriver {
{
int numPointWrites = arbitrary.bounded(100);
int numRangeWrites = arbitrary.bounded(100);
int64_t v = (writeVersion += arbitrary.bounded(2e9));
int64_t v =
(writeVersion += arbitrary.bounded(10) == 0 ? arbitrary.bounded(10)
: arbitrary.next());
auto *writes =
new (arena) ConflictSet::WriteRange[numPointWrites + numRangeWrites];
auto keys = set<std::string_view>(arena);