2017-10-19 16:49:31 -05:00
|
|
|
system "ruby -rrubygems -Ilib bin/puma -p 10102 -C test/shell/t3_conf.rb test/rackup/hello.ru &"
|
2014-01-27 13:13:48 +01:00
|
|
|
sleep 5
|
|
|
|
|
|
|
|
worker_pid_was_present = File.file? "t3-worker-2-pid"
|
|
|
|
|
2020-03-24 22:13:31 +01:00
|
|
|
Process.kill :TERM, Integer(File.read("t3-worker-2-pid")) # kill off a worker
|
2014-01-27 13:13:48 +01:00
|
|
|
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
worker_index_within_number_of_workers = !File.file?("t3-worker-3-pid")
|
|
|
|
|
2020-03-24 22:13:31 +01:00
|
|
|
Process.kill :TERM, Integer(File.read("t3-pid"))
|
2014-01-27 13:13:48 +01:00
|
|
|
|
|
|
|
File.unlink "t3-pid" if File.file? "t3-pid"
|
|
|
|
File.unlink "t3-worker-0-pid" if File.file? "t3-worker-0-pid"
|
|
|
|
File.unlink "t3-worker-1-pid" if File.file? "t3-worker-1-pid"
|
|
|
|
File.unlink "t3-worker-2-pid" if File.file? "t3-worker-2-pid"
|
|
|
|
File.unlink "t3-worker-3-pid" if File.file? "t3-worker-3-pid"
|
|
|
|
|
|
|
|
if worker_pid_was_present and worker_index_within_number_of_workers
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
end
|