Skip to content
Browse files

Kill all processes under jruby/windows

  • Loading branch information...
1 parent 2bb3143 commit 0606ae854d37cbf7d4ebca366be6b280c9d878bb @lstoldt committed
Showing with 11 additions and 7 deletions.
  1. +10 −6 lib/spork/run_strategy/magazine.rb
  2. +1 −1 lib/spork/server.rb
View
16 lib/spork/run_strategy/magazine.rb
@@ -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
View
2 lib/spork/server.rb
@@ -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

1 comment on commit 0606ae8

@kenmgrimm

Had the same problem with jruby / windows. Tried this patch and it works great, thanks!

Please sign in to comment.
Something went wrong with that request. Please try again.