Skip to content

Commit eb37032

Browse files
committed
Make rlimit signal SIGXCPU first; only fallback to SIGKILL later on
1 parent 99ecd32 commit eb37032

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mutmut/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,8 @@ def read_one_child_exit_status():
10141014

10151015
estimated_time_of_tests = m.estimated_time_of_tests_by_mutant[mutant_name]
10161016
cpu_time_limit = ceil((estimated_time_of_tests + 1) * 2 + process_time()) * 10
1017-
resource.setrlimit(resource.RLIMIT_CPU, (cpu_time_limit, cpu_time_limit))
1017+
# signal SIGXCPU after <cpu_time_limit>. One second later signal SIGKILL if it is still running
1018+
resource.setrlimit(resource.RLIMIT_CPU, (cpu_time_limit, cpu_time_limit + 1))
10181019

10191020
with CatchOutput():
10201021
result = runner.run_tests(mutant_name=mutant_name, tests=tests)

0 commit comments

Comments
 (0)