diff options
author | Jeremy Evans <code@jeremyevans.net> | 2022-01-26 17:55:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-26 17:55:30 -0800 |
commit | 0f8bb0fa0fdbef5348d2c82c2f27f529f916a02b (patch) | |
tree | d46dfb12c429cdd11dc1dea00048a2556c971fe4 /test | |
parent | bc7f8d8a7fc73a15e98bfb86a231602fca255fda (diff) | |
download | rack-0f8bb0fa0fdbef5348d2c82c2f27f529f916a02b.tar.gz |
Remove `rack.multithread`/`rack.multiprocess`/`rack.run_once`
These variables generally come too late to be useful. Make `Rack::Lock`
always use a mutex.
Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
Diffstat (limited to 'test')
-rw-r--r-- | test/spec_lock.rb | 23 | ||||
-rw-r--r-- | test/spec_session_pool.rb | 2 | ||||
-rw-r--r-- | test/spec_webrick.rb | 3 |
3 files changed, 1 insertions, 27 deletions
diff --git a/test/spec_lock.rb b/test/spec_lock.rb index 89570498..c86d5b09 100644 --- a/test/spec_lock.rb +++ b/test/spec_lock.rb @@ -139,28 +139,6 @@ describe Rack::Lock do lock.synchronized.must_equal false end - it "set multithread flag to false" do - app = lock_app(lambda { |env| - env['rack.multithread'].must_equal false - [200, { "Content-Type" => "text/plain" }, %w{ a b c }] - }, false) - env = Rack::MockRequest.env_for("/") - env['rack.multithread'].must_equal true - _, _, body = app.call(env) - body.close - env['rack.multithread'].must_equal true - end - - it "reset original multithread flag when exiting lock" do - app = Class.new(Rack::Lock) { - def call(env) - env['rack.multithread'].must_equal true - super - end - }.new(lambda { |env| [200, { "Content-Type" => "text/plain" }, %w{ a b c }] }) - Rack::Lint.new(app).call(Rack::MockRequest.env_for("/")) - end - it 'not unlock if an error is raised before the mutex is locked' do lock = Class.new do def initialize() @unlocked = false end @@ -181,7 +159,6 @@ describe Rack::Lock do end app = Rack::Lock.new lambda { |env| [200, { "Content-Type" => "text/plain" }, proxy.new(env)] } response = app.call(Rack::MockRequest.env_for("/"))[2] - response.env['rack.multithread'].must_equal false end it "unlock if an exception occurs before returning" do diff --git a/test/spec_session_pool.rb b/test/spec_session_pool.rb index e7ed3143..a8e1f3da 100644 --- a/test/spec_session_pool.rb +++ b/test/spec_session_pool.rb @@ -241,7 +241,7 @@ describe Rack::Session::Pool do tnum = rand(7).to_i + 5 r = Array.new(tnum) do Thread.new(treq) do |run| - run.get('/', "HTTP_COOKIE" => cookie, 'rack.multithread' => true) + run.get('/', "HTTP_COOKIE" => cookie) end end.reverse.map{|t| t.run.join.value } r.each do |resp| diff --git a/test/spec_webrick.rb b/test/spec_webrick.rb index d67dd35f..ffb03740 100644 --- a/test/spec_webrick.rb +++ b/test/spec_webrick.rb @@ -50,9 +50,6 @@ describe Rack::Handler::WEBrick do it "have rack headers" do GET("/test") response["rack.version"].must_equal [1, 3] - response["rack.multithread"].must_equal true - assert_equal false, response["rack.multiprocess"] - assert_equal false, response["rack.run_once"] end it "have CGI headers on GET" do |