Fix occasional failure of test_block_decompress_mem_usage()
Increase the memory usage increase limit and also invoke the garbage
collector ahead of testing memory usage increase.
+import gc
import lz4.block
import pytest
@@ -29,10 +30,11 @@ def test_block_decompress_mem_usage(data):
decompressed = lz4.block.decompress(compressed) # noqa: F841
if i % 100 == 0:
+ gc.collect()
snapshot = tracemalloc.take_snapshot()
if prev_snapshot:
stats = snapshot.compare_to(prev_snapshot, 'lineno')
- assert stats[0].size_diff < (1024 * 4)
+ assert stats[0].size_diff < (1024 * 8)
prev_snapshot = snapshot
