We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0240ef4 commit d71f649Copy full SHA for d71f649
1 file changed
Lib/test/test_zstd.py
@@ -2675,15 +2675,17 @@ def test_compress_locking(self):
2675
2676
comp = ZstdCompressor()
2677
parts = []
2678
- for _ in range(num_threads):
+ for _ in range(num_threads + 1):
2679
res = comp.compress(input, ZstdCompressor.FLUSH_BLOCK)
2680
if res:
2681
parts.append(res)
2682
rest1 = comp.flush()
2683
expected = b''.join(parts) + rest1
2684
2685
2686
- output = []
+ # Compress the first block to add the Zstandard header. This ensures
2687
+ # that the parallel portion of the test is thread order independent.
2688
+ output = [comp.compress(input, ZstdCompressor.FLUSH_BLOCK)]
2689
def run_method(method, input_data, output_data):
2690
res = method(input_data, ZstdCompressor.FLUSH_BLOCK)
2691
0 commit comments