Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 713224a36265
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 534cb941038a
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 6, 2016

  1. Make sure the thread is still alive while waiting for pid in Process#…

    …kill
    
    * Handle no pid in cleanup.
    eregon committed Aug 6, 2016
    Copy the full SHA
    0e08149 View commit details
  2. Copy the full SHA
    534cb94 View commit details
Showing with 16 additions and 3 deletions.
  1. +3 −3 spec/ruby/core/process/fixtures/common.rb
  2. +13 −0 spec/truffle/tags/core/process/kill_tags.txt
6 changes: 3 additions & 3 deletions spec/ruby/core/process/fixtures/common.rb
Original file line number Diff line number Diff line change
@@ -45,16 +45,16 @@ def initialize(scenario=nil, ruby_exe=nil)
args = [@pid_file, scenario, ruby_exe]
@result = ruby_exe @script, args: args
end
Thread.pass until File.exist? @pid_file
while @pid.nil? || @pid == 0
Thread.pass while @thread.status and !File.exist?(@pid_file)
while @thread.status && (@pid.nil? || @pid == 0)
@pid = IO.read(@pid_file).chomp.to_i
end
end

def wait_on_result
# Ensure the process exits
begin
Process.kill :TERM, pid
Process.kill :TERM, pid if pid
rescue Errno::ESRCH
# Ignore the process not existing
end
13 changes: 13 additions & 0 deletions spec/truffle/tags/core/process/kill_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
slow:Process.kill raises Errno::ESRCH if the process does not exist
slow:Process.kill accepts a Symbol as a signal name
slow:Process.kill accepts a String as signal name
slow:Process.kill accepts a signal name without the 'SIG' prefix
slow:Process.kill accepts a signal name with the 'SIG' prefix
slow:Process.kill acceps an Integer as a signal value
slow:Process.kill calls #to_int to coerce the pid to an Integer
slow:Process.kill signals multiple processes
slow:Process.kill returns the number of processes signaled
slow:Process.kill signals the process group if the PID is zero
slow:Process.kill signals the process group if the signal number is negative
slow:Process.kill signals the process group if the short signal name starts with a minus sign
slow:Process.kill signals the process group if the full signal name starts with a minus sign