forked from weaselab/conflict-set
Add test that exercises "too large removal buffer" code
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import struct
|
||||||
from conflict_set import *
|
from conflict_set import *
|
||||||
|
|
||||||
|
|
||||||
@@ -164,6 +165,16 @@ def test_fixup_256():
|
|||||||
cs.check(read(0, bytes([1]), bytes([2])))
|
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__":
|
if __name__ == "__main__":
|
||||||
# budget "pytest" for ctest integration without pulling in a dependency. You can of course still use pytest in local development.
|
# budget "pytest" for ctest integration without pulling in a dependency. You can of course still use pytest in local development.
|
||||||
import argparse
|
import argparse
|
||||||
|
|||||||
Reference in New Issue
Block a user