diff --git a/changelog/13693.bugfix.rst b/changelog/13693.bugfix.rst new file mode 100644 index 00000000000..e972d534ab9 --- /dev/null +++ b/changelog/13693.bugfix.rst @@ -0,0 +1 @@ +Fixed an issue where output written to standard output or error could be lost when live logging emitted messages from background threads while using :fixture:`capfd` or :fixture:`capsys`. diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 998a7819972..a34082eb7cb 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1279,7 +1279,9 @@ def make_numbered_dir( maximum one. The number is assumed to start directly after prefix. if keep is true directories with a number less than (maxnum-keep) will be removed. If .lock files are used (lock_timeout non-zero), - algorithm is multi-process safe. + they prevent cleanup of directories currently in use. However, the + allocation and cleanup operations are not safe when called concurrently + from multiple processes; see pytest-dev/pytest#11603. """ if rootdir is None: rootdir = cls.get_temproot()