gh-37883: Safely skip test_resource file size tests when limits are strict#145579
gh-37883: Safely skip test_resource file size tests when limits are strict#145579encukou merged 20 commits intopython:mainfrom
Conversation
|
I have added a news entry, though I am not sure if it's necessary or for this fix, Please let me know if I should remove it :) |
encukou
left a comment
There was a problem hiding this comment.
This looks good!
We don't need a NEWS entry for a test-only change.
|
@encukou Alrighty thank you, I was confused as to add it or not so thank you for clearing that up :), also I will incorporate your reviews in a second :) |
|
I think you can roll back the last 4 commits. In d21ceb8, the removed comment says: That should stay, i.e. the |
|
Alright will look into it asap |
|
@encukou I believe everything should work now :) Sorry for the late reply |
Removed unused import of the 'time' module.
|
@encukou Hi, I believe I fixed the tests that were failing from my side in this PR, I am pretty sure this time, it's not my fault :) lmk if I am to make any other changes :) |
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit 4564e1f 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145579%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
Accepted all suggestions, thanks! |
|
Thank you! |
|
Sorry, @Shrey-N and @encukou, I could not cleanly backport this to |
|
Sorry, @Shrey-N and @encukou, I could not cleanly backport this to |
|
We usually backport test fixes to earlier versions, but mostly to avoid conflicts in future fixes. Since there are conflicts already, I'll skip backporting. If you need the fix in an earlier version, feel free to open a backport PR. |
This fixes the Standing issue #37883 where
test_resourcewould fail on systems with file size limitationsPrevious attempts (like #140872) tried to introduce massive refactoring and helper classes. Based on reviewer feedback I read there, I have tried a minimal fix
self.skipTestwith an informative message rather than failing with an unhandledOSErrororValueError.try...finallyresource restoration blocks withself.addCleanup(), guaranteeing that limits are reset even during a test assertion failure.Fixes #37883