Skip to content

gh-37883: Fix test_resource failures with file size limits#140872

Draft
ritesh006 wants to merge 1 commit intopython:mainfrom
ritesh006:fix-issue-37883
Draft

gh-37883: Fix test_resource failures with file size limits#140872
ritesh006 wants to merge 1 commit intopython:mainfrom
ritesh006:fix-issue-37883

Conversation

@ritesh006
Copy link

@ritesh006 ritesh006 commented Nov 1, 2025

This fixes the long-standing issue where test_resource would fail on systems with file size limitations. The solution includes:

  • ResourceLimitHelper class for safe limit manipulation
  • Dynamic test sizing based on available resources
  • Conditional test skipping with clear messages
  • Comprehensive error handling for various platforms

Tests now adapt to system constraints rather than failing.

Fixes #37883

…limits

This fixes the long-standing issue where test_resource would fail
on systems with file size limitations. The solution includes:

- ResourceLimitHelper class for safe limit manipulation
- Dynamic test sizing based on available resources
- Conditional test skipping with clear messages
- Comprehensive error handling for various platforms

Tests now adapt to system constraints rather than failing.

Fixes python#37883
@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Nov 1, 2025
@python-cla-bot
Copy link

python-cla-bot bot commented Nov 1, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Nov 1, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@picnixz picnixz changed the title bpo-678264/gh-37883: Fix test_resource failures with file size limits gh-37883: Fix test_resource failures with file size limits Nov 1, 2025
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert all unrelated changes. Do not add docstrings to test methods because they will be rendered on failures. Do not change the skipIf/skipUnless, they are irrelevant and reduce the diff readability. Focus on fixing the tests themselves, but not refactoring the existing code (if this is needed, this must be done in a separate PR).

@bedevere-app
Copy link

bedevere-app bot commented Nov 1, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_resource fails when file size is limited

2 participants