Skip to content

Commit d22e766

Browse files
committed
Cannot send SIGTERM to another process on Windows
1 parent 0251abc commit d22e766

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tool/test-bundled-gems.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,15 @@
7979
puts "#{github_actions ? "::group::\e\[93m" : "\n"}Testing the #{gem} gem#{github_actions ? "\e\[m" : ""}"
8080
print "[command]" if github_actions
8181
puts test_command
82-
pid = Process.spawn(test_command, "#{/mingw|mswin/ =~ RUBY_PLATFORM ? 'new_' : ''}pgroup": true)
83-
{nil => first_timeout, INT: 30, TERM: 10, KILL: nil}.each do |sig, sec|
82+
timeouts = {nil => first_timeout, INT: 30, TERM: 10, KILL: nil}
83+
if /mingw|mswin/ =~ RUBY_PLATFORM
84+
timeouts.delete(:TERM) # Inner process signal on Windows
85+
group = :new_pgroup
86+
else
87+
group = :pgroup
88+
end
89+
pid = Process.spawn(test_command, group => true)
90+
timeouts.each do |sig, sec|
8491
if sig
8592
puts "Sending #{sig} signal"
8693
Process.kill("-#{sig}", pid)

0 commit comments

Comments
 (0)