Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Lib/test/test_zstd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2675,15 +2675,17 @@ def test_compress_locking(self):

comp = ZstdCompressor()
parts = []
for _ in range(num_threads):
for _ in range(num_threads + 1):
res = comp.compress(input, ZstdCompressor.FLUSH_BLOCK)
if res:
parts.append(res)
rest1 = comp.flush()
expected = b''.join(parts) + rest1

comp = ZstdCompressor()
output = []
# Compress the first block to add the Zstandard header. This ensures
# that the parallel portion of the test is thread order independent.
output = [comp.compress(input, ZstdCompressor.FLUSH_BLOCK)]
def run_method(method, input_data, output_data):
res = method(input_data, ZstdCompressor.FLUSH_BLOCK)
if res:
Expand Down
Loading