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

test directory doubly-nested running tests with -j/--multiprocess #59505

Closed
cjerdonek opened this issue Jul 9, 2012 · 10 comments
Closed

test directory doubly-nested running tests with -j/--multiprocess #59505

cjerdonek opened this issue Jul 9, 2012 · 10 comments
Labels
tests Tests in the Lib/test dir

Comments

@cjerdonek
Copy link
Member

BPO 15300
Nosy @pitrou, @bitdancer, @florentx, @cjerdonek
Files
  • issue-15300-1.patch
  • issue-15300-2.patch
  • issue-15300-combined.patch
  • issue-15300-3.patch
  • 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 2012-07-11.17:26:56.809>
    created_at = <Date 2012-07-09.01:09:25.946>
    labels = ['tests']
    title = 'test directory doubly-nested running tests with -j/--multiprocess'
    updated_at = <Date 2012-07-11.17:26:56.807>
    user = 'https://github.com/cjerdonek'

    bugs.python.org fields:

    activity = <Date 2012-07-11.17:26:56.807>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-07-11.17:26:56.809>
    closer = 'pitrou'
    components = ['Tests']
    creation = <Date 2012-07-09.01:09:25.946>
    creator = 'chris.jerdonek'
    dependencies = []
    files = ['26322', '26323', '26324', '26347']
    hgrepos = []
    issue_num = 15300
    keywords = ['patch']
    message_count = 10.0
    messages = ['165052', '165055', '165061', '165066', '165079', '165185', '165221', '165261', '165265', '165266']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'r.david.murray', 'flox', 'chris.jerdonek', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue15300'
    versions = ['Python 3.2', 'Python 3.3']

    @cjerdonek
    Copy link
    Member Author

    Running tests using the -j/--multiprocess option doubly-nests the test working directory:

    $ ./python.exe -m test -j3 
    -->cpython/build/test_python_63955/build/test_python_63956 
    $ ./python.exe -m test
    -->cpython/build/test_python_63957

    It seems like the test directories for different processes should be siblings when running in multiprocessing mode as opposed to doubly-nesting under a new build directory.

    @cjerdonek cjerdonek added the tests Tests in the Lib/test dir label Jul 9, 2012
    @cjerdonek
    Copy link
    Member Author

    Attaching a small refactoring patch to eliminate some cut-and-paste, prior to fixing this issue.

    @cjerdonek
    Copy link
    Member Author

    And here is the second part. Combining this with the first patch provides a fix.

    @cjerdonek
    Copy link
    Member Author

    Here is a single combined patch. I gather this is preferred.

    @cjerdonek
    Copy link
    Member Author

    After this patch, it's clear that TEMPDIR and TESTCWD no longer have to be global variables.

    I can make that a separate issue after this one.

    @pitrou
    Copy link
    Member

    pitrou commented Jul 10, 2012

    I don't really like the "pre-parsed option" hack. Can't we think of something simpler? For example, why would the child be involved, rather than simply the parent setting the right cwd?

    Also, I don't think there's any point in _OPTION_CWD_PARENT_DIR. Just hard-code the literal, it will be more readable.

    @cjerdonek
    Copy link
    Member Author

    Thanks for your feedback, Antoine, and for causing me to rethink the patch. This patch is drastically simpler.

    Incidentally, I found a reason for this issue in bpo-15322.

    regrtest calculates the "build" folder relative to sysconfig.get_config_var('srcdir'). Because the latter returns the current working directory instead of the source directory, the build folders were getting nested.

    @pitrou
    Copy link
    Member

    pitrou commented Jul 11, 2012

    Thanks, Chris. I haven't tested the patch but it looks fine.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 11, 2012

    New changeset 724a6e0e35f0 by Antoine Pitrou in branch '3.2':
    Issue bpo-15300: Ensure the temporary test working directories are in the same parent folder when running tests in multiprocess mode from a Python build.
    http://hg.python.org/cpython/rev/724a6e0e35f0

    New changeset 4752fafb579d by Antoine Pitrou in branch 'default':
    Issue bpo-15300: Ensure the temporary test working directories are in the same parent folder when running tests in multiprocess mode from a Python build.
    http://hg.python.org/cpython/rev/4752fafb579d

    @pitrou
    Copy link
    Member

    pitrou commented Jul 11, 2012

    Committed now.

    @pitrou pitrou closed this as completed Jul 11, 2012
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 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

    2 participants