mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Test multiprocessing spawn timing fix (#160672)
Submitting PR to fix #160511. Pull Request resolved: https://github.com/pytorch/pytorch/pull/160672 Approved by: https://github.com/mikaylagawarecki
This commit is contained in:
committed by
PyTorch MergeBot
parent
4051b42c29
commit
dc194a3096
@ -47,7 +47,7 @@ def _test_terminate_signal_func(i):
|
||||
def _test_terminate_exit_func(i, arg):
|
||||
if i == 0:
|
||||
sys.exit(arg)
|
||||
time.sleep(1.0)
|
||||
time.sleep(4.0)
|
||||
|
||||
|
||||
def _test_success_first_then_exception_func(i, arg):
|
||||
@ -145,7 +145,7 @@ class _TestMultiProcessing:
|
||||
with self.assertRaisesRegex(Exception, message):
|
||||
mp.start_processes(_test_terminate_signal_func, nprocs=2, start_method=self.start_method)
|
||||
|
||||
@parametrize("grace_period", [None, 5])
|
||||
@parametrize("grace_period", [None, 20])
|
||||
def test_terminate_exit(self, grace_period):
|
||||
exitcode = 123
|
||||
ctx = mp.start_processes(_test_terminate_exit_func, args=(exitcode,), nprocs=2, start_method=self.start_method, join=False)
|
||||
|
Reference in New Issue
Block a user