Skip to content

tests/test_xdist_handling.py fails with PyTest 8.0.2 and Python 3.12 in Debian CI environment: tries stat on /tmp/systemd-private-xxx #110

Closed
@juliangilbey

Description

@juliangilbey

A bizarre error, which you may have some insight into. I obtain the same error if I use 1.2.0 or the current HEAD (commit a568bb1):

=================================== FAILURES ===================================
_____________________________ test_xdist_ordering ______________________________

tmpdir = local('/tmp/pytest-of-test/pytest-0/test_xdist_ordering0')

    def test_xdist_ordering(tmpdir):
        testname = str(tmpdir.join("first_test.py"))
[... rest of function snipped ...]

        # With `loadfile`, the tests should pass
        args = ["-n3", "--dist=loadfile", str(tmpdir)]
        ret = pytest.main(args, [pytest_order])
>       assert ret == 0
E       assert <ExitCode.TESTS_FAILED: 1> == 0

tests/test_xdist_handling.py:64: AssertionError
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform linux -- Python 3.12.2, pytest-8.0.2, pluggy-1.4.0
rootdir: /tmp
plugins: xdist-3.4.0, dependency-0.5.1, mock-3.12.0
created: 3/3 workers
3 workers [0 items]


==================================== ERRORS ====================================
______________________________ ERROR collecting . ______________________________
/usr/lib/python3/dist-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
/usr/lib/python3/dist-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/usr/lib/python3/dist-packages/_pytest/python.py:211: in pytest_collect_directory
    if pkginit.is_file():
/usr/lib/python3.12/pathlib.py:894: in is_file
    return S_ISREG(self.stat().st_mode)
/usr/lib/python3.12/pathlib.py:842: in stat
    return os.stat(self, follow_symlinks=follow_symlinks)
E   PermissionError: [Errno 13] Permission denied: '/tmp/systemd-private-2dd08cf217854d6285343c302b696375-systemd-logind.service-qOgrXp/__init__.py'
[... a similar error is repeated twice more ...]
=========================== short test summary info ============================
ERROR ../../.. - PermissionError: [Errno 13] Permission denied: '/tmp/systemd...
ERROR ../../.. - PermissionError: [Errno 13] Permission denied: '/tmp/systemd...
ERROR ../../.. - PermissionError: [Errno 13] Permission denied: '/tmp/systemd...
============================== 3 errors in 0.42s ===============================
=========================== short test summary info ============================
FAILED tests/test_xdist_handling.py::test_xdist_ordering - assert <ExitCode.T...
======================== 1 failed, 134 passed in 8.16s =========================

(A full log is attached, in case it is helpful.)

The tests are called as python3.12 -m pytest tests perf_tests in a directory only containing copies of perf_tests and tests.

If you have any idea what might be causing this, I'd be very grateful! It doesn't seem to make any sense that something should be looking in this systemd-private directory.

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