Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for setrlimit() support #36547

Closed
gswagere mannequin opened this issue May 3, 2002 · 9 comments
Closed

Add check for setrlimit() support #36547

gswagere mannequin opened this issue May 3, 2002 · 9 comments
Labels
tests Tests in the Lib/test dir

Comments

@gswagere
Copy link
Mannequin

gswagere mannequin commented May 3, 2002

BPO 551960
Nosy @loewis
Files
  • test_resource.py.patch
  • test_resource.py.patch: Revised to check for error return instead
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2002-12-12.18:14:19.000>
    created_at = <Date 2002-05-03.18:18:19.000>
    labels = ['tests']
    title = 'Add check for setrlimit() support'
    updated_at = <Date 2002-12-12.18:14:19.000>
    user = 'https://bugs.python.org/gswagere'

    bugs.python.org fields:

    activity = <Date 2002-12-12.18:14:19.000>
    actor = 'jlt63'
    assignee = 'jlt63'
    closed = True
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2002-05-03.18:18:19.000>
    creator = 'gsw_agere'
    dependencies = []
    files = ['4224', '4225']
    hgrepos = []
    issue_num = 551960
    keywords = ['patch']
    message_count = 9.0
    messages = ['39833', '39834', '39835', '39836', '39837', '39838', '39839', '39840', '39841']
    nosy_count = 3.0
    nosy_names = ['loewis', 'jlt63', 'gsw_agere']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue551960'
    versions = ['Python 2.3']

    @gswagere
    Copy link
    Mannequin Author

    gswagere mannequin commented May 3, 2002

    The new test_resource test calls resource.setrlimit()
    to change the file size limits. This fails on Cygwin,
    which supports setrlimit() and getrlimit(), just not
    changing that particular setting. (The same would
    apply to any other platforms that has those functions
    but not that particular feature.)

    Since that getrlimit() works, and setrlimit() can be
    used for other reasons, a check for sys.platform was
    added to that part of the test.

    @gswagere gswagere mannequin closed this as completed May 3, 2002
    @gswagere gswagere mannequin assigned jlt63 May 3, 2002
    @gswagere gswagere mannequin added the tests Tests in the Lib/test dir label May 3, 2002
    @gswagere gswagere mannequin closed this as completed May 3, 2002
    @gswagere gswagere mannequin assigned jlt63 May 3, 2002
    @gswagere gswagere mannequin added the tests Tests in the Lib/test dir label May 3, 2002
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented May 6, 2002

    Logged In: YES
    user_id=21627

    Don't check for systems, check for features instead.

    In this specific case, what error does Cygwin report? Could
    that be used to deal with the missing feature in a more
    general way?

    @gswagere
    Copy link
    Mannequin Author

    gswagere mannequin commented May 6, 2002

    Logged In: YES
    user_id=329402

    Cygwin Python raises ValueError when you call setrlimit()
    for RLIMIT_FSIZE. That limit is hardcoded at infinity and
    cannot be changed. I have submitted an alternative patch
    that looks for ValueError rather than checking sys.platform.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jun 2, 2002

    Logged In: YES
    user_id=21627

    I'm not sure I understand the logic in the modified
    setrlimit(FSIZE) case. If setting the limit fails, it seems
    that the entire test should be skipped. Raising TestSkipped
    might be appropriate, to indicate that the result of the
    test is not trustworthy.

    @gswagere
    Copy link
    Mannequin Author

    gswagere mannequin commented Jun 3, 2002

    Logged In: YES
    user_id=329402

    Since there are other limits that can be set via setrlimit(),
    failing the entire test due to a limitation on setrlimit(FSIZE)
    did not seem appropriate (even though this is currently the
    only resource limit that is tested).

    Besides, even though setrlimit(FSIZE) isn't allowed to change
    the value, it should still be able to set it to the values returned
    via getrlimit(), and should still report ValueError for extremely
    large values for either cur or max. So the test is meaningful
    even on systems that aren't allowed to lower the FSIZE limit.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Dec 4, 2002

    Logged In: YES
    user_id=21627

    Jason, can you please review this patch, and apply it if it
    looks ok?

    If not, please unassign it.

    @jlt63
    Copy link
    Mannequin

    jlt63 mannequin commented Dec 12, 2002

    Logged In: YES
    user_id=86216

    The patch looks OK from a Cygwin point of view. However,
    I'm not very knowledgeable in this area. Still OK to apply?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Dec 12, 2002

    Logged In: YES
    user_id=21627

    If "looks ok" means "the test fails without the patch, and
    passes with the patch", then go ahead and apply it.

    @jlt63
    Copy link
    Mannequin

    jlt63 mannequin commented Dec 12, 2002

    Logged In: YES
    user_id=86216

    Checked in as Lib/test/test_resource.py 1.3.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    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

    No branches or pull requests

    0 participants