Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test adding connection to Reactor after shutdown [changelog skip] #2418

Merged
merged 3 commits into from Oct 8, 2020

Conversation

wjordan
Copy link
Contributor

@wjordan wjordan commented Oct 7, 2020

Description

Quick followup to #2279, this PR extends the TestPumaServer#shutdown_requests test-method to pause Reactor#add for the second connection until after shutdown begins, to ensure this edge case is correctly handled.

This adds unit-test coverage for the fix introduced in #2377 and updated in #2279.

This added test revealed that the edge-case wasn't handled properly in Ruby 2.2, so that is fixed in commit 0f4e51f as well.

Finally, commit e5d04eb is a small style-fix followup in the related Reactor code.

Testing

Verified that this modified test fails on the following commits:

  1) Failure:
TestPumaServer#test_shutdown_requests [test/test_puma_server.rb:1016]:
Expected /204/ to match # encoding: ASCII-8BIT
#    valid: true
"HTTP/1.1 500 Internal Server Error\r\n".

  2) Failure:
TestPumaServer#test_force_shutdown [test/test_puma_server.rb:1018]:
Expected # encoding: ASCII-8BIT
#    valid: true
"HTTP/1.1 500 Internal Server Error\r\n" to be nil.
Error reached top of thread-pool: closed stream (IOError)

  1) Failure:
TestPumaServer#test_shutdown_requests [test/test_puma_server.rb:1007]:
timeout waiting for response

  2) Failure:
TestPumaServer#test_force_shutdown [test/test_puma_server.rb:1007]:
timeout waiting for response

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added an entry to History.md if this PR fixes a bug or adds a feature. If it doesn't need an entry to HISTORY.md, I have added [changelog skip] or [ci skip] to the pull request title.
  • I have added appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

Modifies `TestPumaServer#shutdown_requests` to pause `Reactor#add` until after
shutdown begins, to ensure requests are handled correctly for this edge case.
Adds unit-test coverage for the fix introduced in puma#2377 and updated in puma#2279.
Allow `ClosedQueueError` to be raised when `Queue#<<` is called.
@nateberkopec nateberkopec merged commit 761fbaf into puma:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants