gh-152190: Fix memory checking failure in test_zipfile64.py - #152203
Conversation
test_strip_removed_large_file_with_dd_no_sigtest_strip_removed_large_file_with_dd_no_sig
c98f30e to
34a009b
Compare
…arge_file_with_dd_no_sig` Remove the overly restrictive `allowed_memory` override (200 KiB) in `test_strip_removed_large_file_with_dd_no_sig` to prevent a memory checking failure.
Introduce the `assert_memory_usage` context manager to narrow the scope of tracemalloc tracking down exclusively to the file-repacking phase. This prevents previous file-writing side effects from interfering with the baseline, improves tracing accuracy, and eliminates redundant inner sub-function wrappers.
|
It seems that a dynamic memory threshold cannot be easily calculated. Keep the original empirical threshold and revise the comment to be more clear. Additionally, introduce the |
|
!buildbot bigmem |
|
🤖 New build scheduled with the buildbot fleet by @StanFromIreland for commit 5335be0 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F152203%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
test_strip_removed_large_file_with_dd_no_sigtest_zipfile64.py
Remove redundant "TESTFN2" disk space warnings from TestRepack, as these tests exclusively use TemporaryFile(). Additionally, remove the repetitive `self.assertFalse(f.closed)` checks from `TestRepack` methods since it's already verified in `TestsWithSourceFile`.
Rename `TestRepack` to `TestRepacker` to better reflect its coverage of `zipfile._Repacker`. Move heavy text chunk generation and common constants from `setUp` to `setUpClass` to ensure single initialization across tests. Clean up repetitive local definitions of filenames and lorem text by promoting them to class properties. Reduce the test file size from 8 GiB to 4.1 GiB, which is large enough to trigger ZIP64 extension and sufficient for the testing purpose.
|
Thanks @danny0838 for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @danny0838 for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Sorry, @danny0838 and @gpshead, I could not cleanly backport this to |
|
Thanks @danny0838 for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
Sorry, @danny0838 and @gpshead, I could not cleanly backport this to |
|
Sorry, @danny0838 and @gpshead, I could not cleanly backport this to |
|
(this was for a recent feature, no backports needed) |
|
@gpshead Can you help check other remove/repack related PRs? There are at least 3, listed in the README page of the |
Remove the overly restrictive
allowed_memoryoverride (200 KiB) intest_strip_removed_large_file_with_dd_no_sigto prevent a memory checking failure.Additionally, revise the comment about the empirical 10 MiB memory threshold, optimize the code, and clear improper comments.
test_zipfile64.[...].test_strip_removed_large_file_with_dd_no_sigfails on BigMem runs #152190