Skip to content

Missing new release tag blocking upgrade to pytest 9.2.0 breaking loadgroup working #1407

Open

Description

@manefix-hub

Missing new release tag here on fresh master is blocking upgrade to pytest 9.2.0 breaking loadgroup working, so please distribute new tag on latest master

Activity

  1. justmike1 commented on Nov 2, 2026

    @justmike1
  2. gal-a commented on Nov 11, 2026

    @gal-a

    Hit this while developing qikly, on pytest 9.2.0 with pytest-xdist 3.8.0:
    grouped tests were spread across workers with no warning, and tests that
    share files started failing intermittently.

    Until a release includes #1388, two workarounds:

    1. Pin pytest<9.2. With xdist 3.8.0, pytest 9.0.0, 9.1.0 and 9.1.1 still
      group correctly.
    2. Or stay on 9.2 and add this hook to conftest.py. It tags grouped tests
      the way --dist loadgroup expects, through the node id pytest 9.2 reads,
      and runs after xdist's own hook, so on older pytest it leaves tests xdist
      has already tagged alone:
    import pytest
    
    @pytest.hookimpl(trylast=True)  # after xdist's own hook, which tags on pytest < 9.2
    def pytest_collection_modifyitems(config, items):
        if not getattr(config.option, "loadgroup", False):
            return
        for item in items:
            names = sorted({str(m.args[0] if m.args else m.kwargs.get("name", "default"))
                            for m in item.iter_markers("xdist_group")})
            nodeid = item.nodeid
            if not names or nodeid.rfind("@") > nodeid.rfind("]"):  # already tagged
                continue
            tagged = "%s@%s" % (nodeid, "_".join(names))
            if hasattr(item, "_id"):  # pytest 9.2+
                from _pytest.nodeid import coerce_node_id
                item._id = coerce_node_id(tagged)
            else:
                item._nodeid = tagged

    Like xdist itself, it relies on pytest internals, so it is a stopgap to
    delete after the next release. Checked on small reproductions, including parametrize ids containing "@"
    and a test in two groups: with it, each group ran on one worker on pytest
    9.2.0 and 8.4.2.

    Found and checked with the help of an AI coding assistant.

  3. RonnyPfannschmidt commented on Nov 11, 2026

    @RonnyPfannschmidt
    Member

    i started to follow up on what we need to put it to be able to release - as soon as possibe

  4. rgant commented on Nov 16, 2026

    @rgant

    @RonnyPfannschmidt Any thing we can do to help get the next release cut?

  5. RonnyPfannschmidt commented on Nov 17, 2026

    @RonnyPfannschmidt
    Member

    🤖 Written by Claude Opus 5.5 via Claude Code for the pytest-xdist maintainers; I prompted it, it did the work, I read it.

    Release checklist for the next pytest-xdist release, which brings the pytest 9.2 loadgroup fix:

    Not blocking, but nice to have in the same release: #1413 (loadscope scope parsing for ids containing ::) and #1414 (keep the worker interpreter's own sys.path).


    Generated by Claude Code

  6. added a commit that references this issue on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions