Add test that exercises "too large removal buffer" code

This commit is contained in:
2024-11-14 16:40:47 -08:00
parent 08958d4109
commit f403c78410
+11
View File
@@ -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