Skip to content

gh-136394: Make zstd freethreaded compression test order independent #136444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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