Address thread pool test TODOs [changelog skip] #2036
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These TODOs were added in 9f4edf4 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 theauto_reap!
earlier and checking that it hasn't reaped any threads that are still alive.For the other TODO I replaced
sleep 10
with theThread.pass until finish
pattern we use in some other tests in this file. Now ifpool.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 theForceShutdown
error.