Skip to content

Commit d49317e

Browse files
authored
Extend tests for execute_in_subprocess() (#744)
1 parent 8f66e54 commit d49317e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_cache_fileexecutor_serial.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import shutil
55
import unittest
66
from threading import Thread
7+
from time import sleep
78

89
try:
910
from executorlib.task_scheduler.file.subprocess_spawner import (
@@ -214,6 +215,14 @@ def test_executor_function_dependence_args(self):
214215
q.put({"shutdown": True, "wait": True})
215216
process.join()
216217

218+
def test_execute_in_subprocess(self):
219+
process = execute_in_subprocess(
220+
command=["sleep", "5"],
221+
file_name="test.h5",
222+
data_dict={"fn": sleep, "args": (5,)},
223+
)
224+
self.assertIsNone(terminate_subprocess(task=process))
225+
217226
def test_execute_in_subprocess_errors(self):
218227
file_name = os.path.abspath(os.path.join(__file__, "..", "executorlib_cache", "test.h5"))
219228
os.makedirs(os.path.dirname(file_name))

0 commit comments

Comments
 (0)