System Info
Transformers=5.6.0.dev0 (local checkout 85099df);
Python=3.13.5;
Platform=macOS-26.2-arm64-arm-64bit-Mach-O;
pytest=8.4.2;
pytest-xdist=3.8.0
Who can help?
@ydshieh @SunMarc
Information
Tasks
Reproduction
This issue affects internal test utilities and does not involve example scripts or a user dataset/task.
- In src/transformers/testing_utils.py, _prepare_debugging_info() appends to captured_info.txt and patch_testing_methods_to_collect_info() unlinks that same file.
- Run tests under pytest -n 2 with workers sharing the same _PATCHED_TESTING_METHODS_OUTPUT_DIR.
- Observe that workers write to and reset the same captured_info.txt, so one worker can delete or interleave another worker's captured debugging output.
I checked for overlapping issues and PRs and did not find a direct match.
I have a candidate fix with focused tests on my fork here: https://github.com/oleksii-tumanov/transformers/tree/fix/testing-utils-xdist-captured-info (commit 58dcab6). I am opening the issue first for coordination before submitting an upstream PR.
Expected behavior
Each xdist worker should isolate its captured debugging output instead of sharing one captured_info.txt file. For example, worker-specific filenames such as captured_info_gw0.txt and captured_info_gw1.txt would avoid cross-worker clobbering while preserving the current single-file behavior for non-xdist runs.
System Info
Transformers=5.6.0.dev0 (local checkout 85099df);
Python=3.13.5;
Platform=macOS-26.2-arm64-arm-64bit-Mach-O;
pytest=8.4.2;
pytest-xdist=3.8.0
Who can help?
@ydshieh @SunMarc
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
This issue affects internal test utilities and does not involve example scripts or a user dataset/task.
I checked for overlapping issues and PRs and did not find a direct match.
I have a candidate fix with focused tests on my fork here: https://github.com/oleksii-tumanov/transformers/tree/fix/testing-utils-xdist-captured-info (commit 58dcab6). I am opening the issue first for coordination before submitting an upstream PR.
Expected behavior
Each xdist worker should isolate its captured debugging output instead of sharing one
captured_info.txtfile. For example, worker-specific filenames such ascaptured_info_gw0.txtandcaptured_info_gw1.txtwould avoid cross-worker clobbering while preserving the current single-file behavior for non-xdist runs.