These TODOs were added in 9f4edf4c while cleaning up the tests a bit.
For the first TODO, it looks like there was a point to those two lines:
this and the previous test call `Thread.current.kill` in the thread pool
block so the threads will die once some work is added. I tried to make
this more obvious by starting the `auto_reap!` earlier and checking that
it hasn't reaped any threads that are still alive.
For the other TODO I replaced `sleep 10` with the `Thread.pass until
finish` pattern we use in some other tests in this file. Now if
`pool.shutdown(0)` fails to raise an error we finish right away rather
than waiting for the 5 second ConditionVariable timeout. I also added an
assertion to ensure we rescue the `ForceShutdown` error.
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.
* Move shutdown grace time constant to ThreadPool.
SHUTDOWN_GRACE_TIME is the only constant (from const.rb) used by
ThreadPool. It's better to move the constant than require all const.rb.
* Fix minor typo.
* Don't need to check if timeout is zero to immediately shutdown.
This removes the duplicated code and add test for forced shutdowns.
Using the work queue to communicate trimming doesn't work, it's far too
easy to starve the system doing that. Instead we now detect trimming and
work as seperate actions.