mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
parent
df57cecce5
commit
39f9c72d93
5 changed files with 60 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
* Bugfixes
|
||||
* Resolve issue with threadpool waiting counter decrement when thread is killed
|
||||
* Constrain rake-compiler version to 0.9.4 to fix `ClassNotFound` exception when using MiniSSL with Java8.
|
||||
* Fix recursive `prune_bundler` (#2319).
|
||||
|
||||
## 5.0.0
|
||||
|
||||
|
|
|
@ -288,6 +288,7 @@ module Puma
|
|||
end
|
||||
|
||||
def prune_bundler
|
||||
return if ENV['PUMA_BUNDLER_PRUNED']
|
||||
return unless defined?(Bundler)
|
||||
require_rubygems_min_version!(Gem::Version.new("2.2"), "prune_bundler")
|
||||
unless puma_wild_location
|
||||
|
|
14
test/config/prune_bundler_with_multiple_workers.rb
Normal file
14
test/config/prune_bundler_with_multiple_workers.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
require 'bundler/setup'
|
||||
Bundler.setup
|
||||
|
||||
prune_bundler true
|
||||
|
||||
workers 2
|
||||
|
||||
app do |env|
|
||||
[200, {}, ["embedded app"]]
|
||||
end
|
||||
|
||||
lowlevel_error_handler do |err|
|
||||
[200, {}, ["error page"]]
|
||||
end
|
|
@ -198,6 +198,30 @@ RUBY
|
|||
assert output, "Friendly fork didn't run"
|
||||
end
|
||||
|
||||
def test_prune_bundler_with_multiple_workers
|
||||
cli_server "", config: <<RUBY
|
||||
require 'bundler/setup'
|
||||
Bundler.setup
|
||||
|
||||
prune_bundler true
|
||||
|
||||
workers 2
|
||||
|
||||
app do |env|
|
||||
[200, {}, ["embedded app"]]
|
||||
end
|
||||
|
||||
lowlevel_error_handler do |err|
|
||||
[200, {}, ["error page"]]
|
||||
end
|
||||
RUBY
|
||||
|
||||
connection = connect
|
||||
reply = read_body(connection)
|
||||
|
||||
assert reply, "embedded app"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def worker_timeout(timeout, iterations, config)
|
||||
|
|
|
@ -90,6 +90,26 @@ class TestIntegrationPumactl < TestIntegration
|
|||
@server = nil
|
||||
end
|
||||
|
||||
def test_prune_bundler_with_multiple_workers
|
||||
skip NO_FORK_MSG unless HAS_FORK
|
||||
|
||||
cli_server "-q -C test/config/prune_bundler_with_multiple_workers.rb --control-url unix://#{@control_path} --control-token #{TOKEN} -S #{@state_path}", unix: true
|
||||
|
||||
s = UNIXSocket.new @bind_path
|
||||
@ios_to_close << s
|
||||
s << "GET / HTTP/1.0\r\n\r\n"
|
||||
|
||||
body = s.read
|
||||
|
||||
assert_match "200 OK", body
|
||||
assert_match "embedded app", body
|
||||
|
||||
cli_pumactl "stop", unix: true
|
||||
|
||||
_, status = Process.wait2(@pid)
|
||||
@server = nil
|
||||
end
|
||||
|
||||
def test_kill_unknown
|
||||
skip_on :jruby
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue