1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/test/shell/t3.rb
Nate Berkopec f4ce5fe9ee Run integration tests in default (#1394)
* Run integration tests in default

* Add retry in CI

* Convert integration test to ruby script for Windows

* Attempt to add finicky tests back

* Possible kinda janky solution

* Only run master branch on travis (syntax fix)

* Don't do integration tests on windows

Can't be bothered to make those tests crossplatform

* Remove join timeouts on read, let the main test timeout do it

* Assert once

* Sigh.
2017-08-16 16:07:15 -06:00

24 lines
714 B
Ruby

system "ruby -rubygems -Ilib bin/puma -p 10102 -C test/shell/t3_conf.rb test/rackup/hello.ru &"
sleep 5
worker_pid_was_present = File.file? "t3-worker-2-pid"
system "kill `cat t3-worker-2-pid`" # kill off a worker
sleep 2
worker_index_within_number_of_workers = !File.file?("t3-worker-3-pid")
system "kill `cat t3-pid`"
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