diff --git a/Lib/test/test_zipfile64.py b/Lib/test/test_zipfile64.py index 7d802d59849ce1..135ac5a06df011 100644 --- a/Lib/test/test_zipfile64.py +++ b/Lib/test/test_zipfile64.py @@ -15,6 +15,7 @@ import time import tracemalloc import sys +import io import unittest.mock as mock from tempfile import TemporaryFile @@ -100,8 +101,9 @@ def setUp(self): # It will contain enough copies of self.data to reach about 8 GiB. self.datacount = 8*1024**3 // len(self.data) - # memory usage should not exceed 10 MiB - self.allowed_memory = 10*1024**2 + # Memory usage should not exceed the default buffer size too + # much (10x as threshold) + self.allowed_memory = max(zipfile._REPACK_CHUNK_SIZE, io.DEFAULT_BUFFER_SIZE) * 10 def _write_large_file(self, fh): next_time = time.monotonic() + _PRINT_WORKING_MSG_INTERVAL @@ -201,7 +203,6 @@ def test_strip_removed_large_file_with_dd_no_sig(self): large file without causing a memory issue.""" # Reduce data scale for this test, as it's especially slow... self.datacount = 30*1024**2 // len(self.data) - self.allowed_memory = 200*1024 # Try the temp file. If we do TESTFN2, then it hogs # gigabytes of disk space for the duration of the test.