diff --git a/nomt/tests/rollback.rs b/nomt/tests/rollback.rs index 5be1879a..faee065d 100644 --- a/nomt/tests/rollback.rs +++ b/nomt/tests/rollback.rs @@ -104,7 +104,7 @@ struct TestPlan { impl TestPlan { /// Generate a test plan for a NOMT with `n` commits. The zero-th commit always corresponds /// to the initial empty tree. - fn generate(name: &'static str, n: usize) -> Self { + fn generate(name: &'static str, n: usize, overflow: bool) -> Self { let mut every_key = BTreeSet::new(); let mut to_insert = Vec::new(); let mut to_remove = Vec::new(); @@ -127,7 +127,17 @@ impl TestPlan { key[30] = commit_ix as u8; key[31] = j as u8; let key = *blake3::hash(&key).as_bytes(); - let value: Vec = blake3::hash(&key).as_bytes().to_vec(); + + let value: Vec = if overflow { + // 32KB + std::iter::repeat(blake3::hash(&key).as_bytes()) + .take(1024) + .flatten() + .copied() + .collect() + } else { + blake3::hash(&key).as_bytes().to_vec() + }; // vec![commit_ix as u8, j as u8]; per_commit_insert.insert(key, value.clone()); @@ -288,7 +298,7 @@ fn display_keys_and_values<'a>(kv: impl IntoIterator