From f403c78410f0db617eaa80788b22942ffaffc9b3 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Thu, 14 Nov 2024 16:40:47 -0800 Subject: [PATCH] Add test that exercises "too large removal buffer" code --- test_conflict_set.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test_conflict_set.py b/test_conflict_set.py index c18f83b..0b4b156 100644 --- a/test_conflict_set.py +++ b/test_conflict_set.py @@ -1,3 +1,4 @@ +import struct from conflict_set import * @@ -164,6 +165,16 @@ def test_fixup_256(): cs.check(read(0, bytes([1]), bytes([2]))) +def test_large_removal_buffer(): + with DebugConflictSet() as cs: + for i in range(1000): + # create extra gc work + for j in range(100): + cs.addWrites(1000 + i) + cs.addWrites(1000 + i, write(struct.pack(">l", i) + bytes([0] * 100000))) + cs.setOldestVersion(i) + + if __name__ == "__main__": # budget "pytest" for ctest integration without pulling in a dependency. You can of course still use pytest in local development. import argparse