From 9554ebe44e6e73dc75105d4935d41e626e03299b Mon Sep 17 00:00:00 2001 From: Rohan Varma Date: Mon, 22 Nov 2021 09:51:34 -0800 Subject: [PATCH] [Dist CI][BE] c10d gloo tests run in subprocess (#68504) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/68504 Per title ghstack-source-id: 143928767 Test Plan: CI Reviewed By: H-Huang Differential Revision: D32485100 fbshipit-source-id: a55687aea4af69e3830aee6f0278550c72f142c2 --- test/run_test.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/run_test.py b/test/run_test.py index e4b27320a47..e97b5cbb3ba 100644 --- a/test/run_test.py +++ b/test/run_test.py @@ -464,6 +464,10 @@ def test_cuda_primary_ctx(test_module, test_directory, options): run_test_with_subprocess = functools.partial(run_test, extra_unittest_args=["--subprocess"]) +def get_run_test_with_subprocess_fn(): + return lambda test_module, test_directory, options: run_test_with_subprocess(test_module, test_directory, options) + + def _test_cpp_extensions_aot(test_directory, options, use_ninja): if use_ninja: @@ -613,10 +617,8 @@ CUSTOM_HANDLERS = { "test_cpp_extensions_aot_no_ninja": test_cpp_extensions_aot_no_ninja, "test_cpp_extensions_aot_ninja": test_cpp_extensions_aot_ninja, "distributed/test_distributed_spawn": test_distributed, - "distributed/test_c10d_nccl": lambda test_module, test_directory, options: - run_test_with_subprocess( - test_module, test_directory, options - ), + "distributed/test_c10d_nccl": get_run_test_with_subprocess_fn(), + "distributed/test_c10d_gloo": get_run_test_with_subprocess_fn(), }