1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
Commit graph

18 commits

Author SHA1 Message Date
MSP-Greg
4c8d4d6921 Update test_integration files per PR #1956 (#1965)
* Update test_integration files per PR #1956

test_integration_cluster.rb

Request handling during server TERM - two tests

`#test_term_closes_listeners_tcp`
`#test_term_closes_listeners_unix`

using `#term_closes_listeners`

Send requests 10 per second.  Send 10, then :TERM server, then send another 30.
No more than 10 should throw Errno::ECONNRESET.

Request handling during phased restart - two tests

`#test_usr1_all_respond_tcp`
`#test_usr1_all_respond_unix`

using `#usr1_all_respond`

Send requests 1 per second.  Send 1, then :USR1 server, then send another 24.
All should be responded to, and at least three workers should be used

Stuck worker tests - two tests

`#test_stuck_external_term_spawn`
Tests whether externally TERM'd 'stuck' workers are proper re-spawned.

`#test_stuck_phased_restart`
Tests whether 'stuck' workers are properly shutdown during phased-restart.

helper files/methods changes

1. helper file changes to allow binding to TCP or UNIX, see kwarg unix:
2. Skip on Windows for signal TERM

* Misc updates, debug output, cleanup

* Add comments

* fix test_int_signal_with_background_thread_in_jruby per review

* TestIntegrationCluster#term_closes_listeners - add interleaved assert

* cluster.rb - remove duplicate Worker#term? method
2019-09-19 19:37:53 +02:00
MSP-Greg
544bb7ae81 PluginRegistry#fire_background - fix up per issue 1972 (#1973)
* PluginRegistry#fire_background - Close #1972

* add test/test_plugin.rb, test/config/plugin1.rb
2019-09-18 15:53:29 +02:00
Nate Berkopec
4d7542e75f
Remove unused test support files 2019-09-11 12:36:40 +00:00
Dave Allie
809a3f4c7b Allow extra runtime deps to be defined when using prune_bundler (#1105)
* Allow extra runtime deps to be defined when using prune_bundler

* Check extra_runtime_dependencies is set before iterating over them

* Load additional paths for extra runtime dep gems

* Don't load extra dependencies, just add their paths to $LOAD_PATH

* Fix typos and extraneous checks and rescues

* Use Gem::Specification#full_require_paths when available

* Prevent use of prune_bundler and extra_runtime_dependencies with early versions of RubyGems

* Ensure LOAD_PATH is modified by extra_runtime_dependencies

* Refactor prune_bundler in launcher.rb and write some unit tests
2019-09-02 16:10:33 +00:00
Yoann Lecuyer
b0c56db7f6 Allow to define a custom formatter for logs (#1816)
* Allow to define a custom formatter for logs
2019-08-01 12:21:23 -07:00
Jesús Burgos Maciá
d39fe92a2d Fixes the bug that wouldn't allow no_token be set to true (#1803)
* Fix crash when no_token is set

* Use a more meaningful name instead of an empty string

* Adds a test to ensure `{ no_token: true }` works

* Adds an explanation for the usage of a String

Just to justify the use of a String instead of a Symbol.

* Removes thread that would start the server

This removes the part of the test that would start the server. The
reason why the thread was being created originally in the PR was to
ensure that the server was booting even with `{ no_token: true }`.

I believe we don't need to test the full server boot but just ensure
that we won't pass a Symbol to OptionParser. In particular the test
ensures that the token will be set to `'none'` when `no_token: true`.

There're already other tests testing that the server boots.
2019-05-28 09:37:34 -04:00
Evan Phoenix
6568aaeaf5
Merge pull request #1689 from michaelherold/allow-ca-to-be-set-in-bind-dsl
Allow mutual TLS CA to be set using `ssl_bind` DSL
2019-03-11 16:39:52 -07:00
Michał Kulesza
ac0652f5a1 add tests 2019-02-21 21:31:35 +01:00
Michael Herold
5a92683afd
Allow mutual TLS CA to be set using ssl_bind DSL
When using mutual TLS, you must specify the CA certificate chain to use
for verifying the peer. Using Puma's `ssl_bind` DSL did not give you the
option of doing so, which lead to confusing errors when attempting to
use it.

Now, when specifying the `verify_mode` as either `peer` or `force_peer`,
you can use the DSL to set the `ca` value as needed within the `Binder`.
This allows you to use the DSL instead of falling back to the default
`bind` syntax via the URI-style configuration pattern.
2019-02-20 14:27:00 -06:00
mitto
cf15db20b9 worker_timeout, worker_boot_timeout, worker_shutdown_timeout fix integer convert (#1450)
* worker_timeout, worker_boot_timeout, worker_shutdown_timeout fix integer convert

* persistent_timeout, first_data_timeout fix integer convert

* add integer convert test case

* fix method name typo

* switch gem update --system
2018-03-19 15:05:15 -06:00
Vladimir Dementyev
2cb2357d39 Let's use Rubocop! (#1325)
* Add limited rubocop config and TODO config

* Remove trailing whitespaces and blanklines

* Add rubocop rake task; upd travis.yml
2017-06-04 13:21:05 -07:00
Michael Grosser
61de1a8891 sort configs/rackups/tests (#1268) 2017-04-11 14:08:18 -07:00
Thomas Walpole
5f24229fbc Specified parameters should overwrite loaded config files 2017-01-30 20:29:19 -08:00
Evan Phoenix
663666c5b7 Add plugin mechanism and initial plugin 2016-02-06 22:28:02 -08:00
Sven Riedel
c365f2d1fc Don't persist before_fork hook in state file 2015-12-10 09:01:47 +01:00
schneems
3f2fb13fcd Ignore multiple port declarations
Right now if you specify a port via `-p $PORT` and via a `config/puma.rb` then puma will incorrectly try to bind to the same port twice and will fail.

This PR calls `uniq!` on the array to remove duplicate ports from the `binds` array.
2015-02-17 08:58:19 -06:00
Arthur Neves
e424eaf052
Add config to customize the default error message
Add a lowlevel_error_handler, so we can customize the default error
message.

example:

```
lowlevel_error_handler do
  [302, {'Content-Type' => 'text', 'Location' => 'foo.html'}, ['302 found']]
end
```

[fix #458]
2014-02-17 12:29:58 -05:00
Evan Phoenix
e88fc14952 Refactor more of the configuration 2011-12-07 13:43:10 -08:00