When a test that boots a server fails it may not properly close out the port. When this happens there is a cascading failure as all other tests that use that port also fail. It becomes hard to find the actual failure reason. This commit uses a new number of every time port is used.
running `rake` loads all files starting with `test_` which is not supposed to also load the helper,
since the helper should be loaded by each test and is not a test itself.
* Bump minitest version.
* Add basic test helper file.
* Use minitest for web server tests.
* Use Minitest for unix socket tests.
* Use Minitest for ThreadPool tests.
* Use Minitest for TCP-Rack tests
* Use Minitest for TCPLogger tests.
* Add missing helper to test helpers.
* Use Minitest for Rack server tests.
* Use Minitest for Rack handler tests.
* Use Minitest for Puma::Server tests.
* Use Minitest for Puma::Server with SSL tests.
* Use Minitest for persisten connections tests.
* Require puma in test_helper file.
* Use minitest for Puma::NullIO tests.
* Remove unnecessary requires on test files.
* Use Minitest for MiniSSL tests.
* Use Minitest for IOBuffer tests.
* Require bundler/setup in Rakefile.
* Use Minitest for HttpParser tests.
* Use Minitest for Puma::Configuration tests.
* Use Minitest for Puma::CLI tests.
* Bump Minitest version for Ruby 2.1 Gemfile.
* Use Minitest for integration tests.
* Use Minitest for Puma::App::Status tests.
* Remove test-unit from Gemfiles.
* Add timeout helper to Minitest::Test.
* Use Minitest for Puma::Binder tests.
* Remove testhelp file.
* Add missing require to Puma::Binder tests.
* Prefer require instead of require_relative.
A zero-length chunk has a protocol-significant meaning: it signals the
end of the response. An empty part in a Rack body has no such meaning,
so we should just skip it.
Some HTTP verbs imply that no body is sent with
the response. Puma did not respect that.
This led to issues like this one:
$ curl localhost:9292
curl: (18) transfer closed with outstanding
read data remaining
This also breaks persistent connections.
Example program to program to provoke this issue:
proc do
[204, {'Conten-Type' => 'text/plain'}, []]
end
Signed-off-by: Konstantin Haase <konstantin.mailinglists@googlemail.com>
Seems that an HTTP/1.0 client needs to be told that the connection is
still in keep alive mode by setting the Connection header to Keep-Alive.
This makes sense because a server could deny the request and thus no
Connection header means close mode.