Cannot send signal to process group on Windows
This commit is contained in:
parent
d22e766042
commit
cec45aedb5
Notes:
git
2025-04-09 13:49:37 +00:00
@ -83,14 +83,16 @@ File.foreach("#{gem_dir}/bundled_gems") do |line|
|
||||
if /mingw|mswin/ =~ RUBY_PLATFORM
|
||||
timeouts.delete(:TERM) # Inner process signal on Windows
|
||||
group = :new_pgroup
|
||||
pg = ""
|
||||
else
|
||||
group = :pgroup
|
||||
pg = "-"
|
||||
end
|
||||
pid = Process.spawn(test_command, group => true)
|
||||
timeouts.each do |sig, sec|
|
||||
if sig
|
||||
puts "Sending #{sig} signal"
|
||||
Process.kill("-#{sig}", pid)
|
||||
Process.kill("#{pg}#{sig}", pid)
|
||||
end
|
||||
begin
|
||||
break Timeout.timeout(sec) {Process.wait(pid)}
|
||||
@ -98,7 +100,7 @@ File.foreach("#{gem_dir}/bundled_gems") do |line|
|
||||
end
|
||||
rescue Interrupt
|
||||
exit_code = Signal.list["INT"]
|
||||
Process.kill("-KILL", pid)
|
||||
Process.kill("#{pg}KILL", pid)
|
||||
Process.wait(pid)
|
||||
break
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user