From 94a9fc8b145ff99be6731b5ef4ba3a481443c46b Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Tue, 27 Oct 2026 02:16:18 +0800 Subject: [PATCH] test(python): isolate fork worker core dumps for diagnosis --- python/python/tests/test_torch.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/python/tests/test_torch.py b/python/python/tests/test_torch.py index 0c6e85294..724a6249a 100644 --- a/python/python/tests/test_torch.py +++ b/python/python/tests/test_torch.py @@ -328,6 +328,10 @@ def _fork_dataloader_diagnostics(worker_id=None): faulthandler.disable() faulthandler.enable(all_threads=True) faulthandler.register(signal.SIGUSR1, all_threads=True, chain=False) + if worker_id is not None and (core_root := os.environ.get("PR3851_CORE_DIRECTORY")): + core_directory = Path(core_root) / str(os.getpid()) + core_directory.mkdir() + os.chdir(core_directory) def _join_fork_dataloader(proc):