python / cpython

The Python programming language
https://www.python.org/
Other
60.05k stars 29.08k forks source link

test largefile support (test_largefile.py) #32434

Closed bdaf8532-ded6-4d4c-9bb3-51fd76040dc1 closed 23 years ago

bdaf8532-ded6-4d4c-9bb3-51fd76040dc1 commented 23 years ago
BPO 400511
Nosy @gvanrossum, @tim-one, @freddrake
Files
  • None: None
  • 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: ```python assignee = None closed_at = created_at = labels = ['library'] title = 'test largefile support (test_largefile.py)' updated_at = user = 'https://bugs.python.org/tmick' ``` bugs.python.org fields: ```python activity = actor = 'tmick' assignee = 'tmick' closed = True closed_date = None closer = None components = ['Library (Lib)'] creation = creator = 'tmick' dependencies = [] files = ['2442'] hgrepos = [] issue_num = 400511 keywords = ['patch'] message_count = 9.0 messages = ['32717', '32718', '32719', '32720', '32721', '32722', '32723', '32724', '32725'] nosy_count = 4.0 nosy_names = ['gvanrossum', 'tim.peters', 'fdrake', 'tmick'] pr_nums = [] priority = 'normal' resolution = None stage = None status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue400511' versions = [] ```

    bdaf8532-ded6-4d4c-9bb3-51fd76040dc1 commented 23 years ago
    freddrake commented 23 years ago

    Looks good to me, and properly skips the large file test on my Linux box. A second iteration may be useful to provide separate options for different resources (cpu/disk/ram), but it's not clearly needed at this time.

    Accepted as-is.

    gvanrossum commented 23 years ago

    This was accepted ages agon -- what are you waiting for?

    tim-one commented 23 years ago

    Fred, can you test this on a Linux with > 2Gb files (needs the --have-resources switch; read Trent's comment), or pass it on to someone who can? I can't do more than stare at this, and nothing in my staring hit my eye. Well, Guido may hate the long option name (--have-resources), especially given that even with all those letters \<wink>, it's not really self-describing.

    tim-one commented 23 years ago

    Fred, do something with this or assign it to some other Unix geek?

    bdaf8532-ded6-4d4c-9bb3-51fd76040dc1 commented 23 years ago

    I confirm that, to the best of my knowledge and belief, this contribution is free of any claims of third parties under copyright, patent or other rights or interests ("claims"). To the extent that I have any such claims, I hereby grant to CNRI a nonexclusive, irrevocable, royalty-free, worldwide license to reproduce, distribute, perform and/or display publicly, prepare derivative versions, and otherwise use this contribution as part of the Python software and its related documentation, or any derivative versions thereof, at no cost to CNRI or its licensed users, and to authorize others to do so.

    I acknowledge that CNRI may, at its sole discretion, decide whether or not to incorporate this contribution in the Python software and its related documentation. I further grant CNRI permission to use my name and other identifying information provided to CNRI by me for use in connection with the Python software and its related documentation.

    bdaf8532-ded6-4d4c-9bb3-51fd76040dc1 commented 23 years ago

    This patch adds a test for largefiles (creating, seeking, telling, etc.). The test skips if there is no largefile support.

    There is one further problem. The test basically involves creating a file greater than 2GB and playing with it. On UN*X systems with sparse files this is no problem. On Win64 (which I have heard *can do sparse files, but not in Python yet), however, >2GB space and a *long time is required to run the test. I don't think it is reasonable to turn this on by default... so here is what I did.

    I extended regrtest.py to accept the --have-resources switch. This sets test_support.use_large_resources, which is checked in test_largefile.py. By default 'use_large_resources' is false. On Win64, then, by default the largefile test is skipped but can be run via the --have-resources switch to regrtest.py or by running the test directly. This seems to me the Right Thing.

    The affected files are: Lib/test/regrtest.py Lib/test/test_support.py Lib/test/test_largefile.py (new) Lib/test/output/test_largefile (new)

    bdaf8532-ded6-4d4c-9bb3-51fd76040dc1 commented 23 years ago

    --have-at-least-2GB-on-hard-drive-and-am-going-for-coffee-\<wink>

    bdaf8532-ded6-4d4c-9bb3-51fd76040dc1 commented 23 years ago

    Sorry about the delay. Had to make some small changes to get the old patch to apply.