Commit d2f497c
Store correctness contract test suite (#212)
* Add Store correctness contract test suite
Defines a run_contract_suite() function that tests every observable
behaviour of a Store implementation:
- Empty-store edge cases (range query, exact query, earliest timestamp)
- Single insert: range query hit/miss, exact query hit/miss (wrong start,
wrong end)
- Batch insert: count correctness, chronological ordering guaranteed
- Partial range filtering (windows outside query range excluded)
- Aggregation-ID isolation (inserts into agg 1 not visible to agg 2)
- Earliest-timestamp tracking: global minimum, per agg-ID
- Cleanup — CircularBuffer: oldest window evicted, newest 8 retained
- Cleanup — ReadBased: evicted after threshold reads, unread window kept
- Concurrency: 8-thread concurrent inserts (no data loss),
8-thread concurrent reads (each returns full result set)
Two test entry points exercise both existing implementations:
contract_per_key — LockStrategy::PerKey (reference)
contract_global — LockStrategy::Global
Adding a new Store implementation requires only a new #[test] function
that calls run_contract_suite() with the new factory.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Extend store contract tests: all accumulator types, keyed entries, DeltaSet exclusion
- Add SerializableToSink import so clone-fidelity tests compile on concrete types
- Clone fidelity tests for all 11 accumulator types: SumAccumulator,
MinMaxAccumulator, DatasketchesKLLAccumulator, IncreaseAccumulator,
MultipleSumAccumulator, MultipleMinMaxAccumulator, SetAggregatorAccumulator,
DeltaSetAggregatorAccumulator, CountMinSketchAccumulator,
CountMinSketchWithHeapAccumulator, HydraKllSketchAccumulator
- Three keyed-entry tests: grouping by key, coexistence of keyed/unkeyed, multiple keys per window
- DeltaSetAggregator cleanup exclusion test
- Concurrency tests: concurrent inserts (8 threads) and concurrent reads
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix cargo fmt violations in store_correctness_tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Remove unused assert_clone_fidelity function (clippy dead_code)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix extra blank line (cargo fmt)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e6e1858 commit d2f497c
2 files changed
Lines changed: 994 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
0 commit comments