Skip to content
Open
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
7 changes: 4 additions & 3 deletions Lib/test/test_zipfile64.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import time
import tracemalloc
import sys
import io
import unittest.mock as mock

from tempfile import TemporaryFile
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
Loading