From 3a0362a6028b949016cd2a67bbeeab9b8d8bf50c Mon Sep 17 00:00:00 2001 From: RobinFrcd <29704178+RobinFrcd@users.noreply.github.com> Date: Sat, 8 Aug 2020 00:52:47 +0200 Subject: Propagate SIGTERM to child processes (#19) SIGTERM sent to taskipy are handed over to task subprocess --- tests/test_taskipy.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/test_taskipy.py') diff --git a/tests/test_taskipy.py b/tests/test_taskipy.py index 5733006..37b322d 100644 --- a/tests/test_taskipy.py +++ b/tests/test_taskipy.py @@ -247,6 +247,20 @@ class InterruptingTaskTestCase(TaskipyTestCase): self.assertEqual(exit_code, 130) + def test_sigterm_should_be_sent_to_subprocess(self): + cwd = self.create_test_dir_from_fixture('project_with_tasks_that_handle_sigterm') + process = self.start_taskipy_process('run_loop_with_sigterm_handling', cwd=cwd) + + time.sleep(.2) + + process.send_signal(signal.SIGTERM) + + exit_code = process.wait() + stdout, _ = process.communicate() + + self.assertEqual(exit_code, 123) + self.assertSubstr('sigterm', str(stdout)) + class CustomRunnerTestCase(TaskipyTestCase): def test_running_command_with_custom_runner(self): -- cgit v1.2.3