Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #139 from lstoldt/master

Kill all processes under JRuby/Windows
  • Loading branch information...
commit 5119287ae9550867ff66012936d228be4cb5a24c 2 parents 94265c6 + 0606ae8
Tim Harper timcharper authored
Showing with 11 additions and 7 deletions.
  1. +10 −6 lib/spork/run_strategy/magazine.rb
  2. +1 −1  lib/spork/server.rb
16 lib/spork/run_strategy/magazine.rb
View
@@ -106,22 +106,26 @@ def run(argv, stderr, stdout)
def restart_slave(id)
pid = @pids[id]
- Process.kill(9, pid)
+ kill_slave(pid)
start_slave(id)
end
def windows?
ENV['OS'] == 'Windows_NT'
end
+
+ def kill_slave(pid)
+ if windows?
+ system("taskkill /f /t /pid #{pid} > nul")
+ else
+ Process.kill(9, pid)
+ end
+ end
def kill_all_processes
@pids.each {|pid|
- if windows?
- system("taskkill /f /pid #{pid}")
- else
- Process.kill(9, pid)
- end
+ kill_slave(pid)
}
puts "\nKilling processes."; $stdout.flush
end
2  lib/spork/server.rb
View
@@ -66,8 +66,8 @@ def restart
def sig_int_received
stdout.puts "\n"
+ abort
if run_strategy.running?
- abort
stderr.puts "Running tests stopped. Press CTRL-C again to stop the server."
stderr.flush
else
Please sign in to comment.
Something went wrong with that request. Please try again.