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

Ensure Puma runs in 0:1 configuration #40116

Closed
wants to merge 1 commit into from

Conversation

maschwenk
Copy link
Contributor

@maschwenk maschwenk commented Aug 27, 2020

Summary

Ensure Puma always runs in 0:1 configuration when running feature specs.

Other Information

#28083
#30712
#30638

It seems at some point Rails was told to point to the default Puma server config baked into Capybara, but that never enforced the required 0:1 Puma thread config that's necessary for transactional fixtures.

#30638 (comment)

This comment above gets at the issue.

@eileencodes and @twalpole have context here, @eileencodes I see you have done a lot of work since then on DB connection sharing for Rails 6. Unsure what the correct configuration is now.

@twalpole
Copy link
Contributor

twalpole commented Aug 27, 2020

I'm unclear why 0:1 is required for this. No one I know has had issues running with the default setup here since the DB connection is shared between the threads. If you're modifying the actual DB connection in one of your threads then you're going to have issues even with 0:1 because you're still sharing the DB connection between the app thread and the test thread, and probably shouldn't be using DB connection sharing at all.

@maschwenk
Copy link
Contributor Author

maschwenk commented Aug 27, 2020

@twalpole Fair point. It was introduced here I believe. I had assumed that was a technical choice rather than a sensible default. If it was not indeed a technical choice, then I'll close this PR. I did notice that when my app runs:

  1. 0:1 we get a lot of flakiness in specs
  2. 0:4 (the capybara default) we get a bunch of PG::ProtocolViolation: ERROR: bind message supplies 0 parameters, but prepared statement "" requires 5

This is on Ruby 2.5.8, Rails 5.2.4.3, Capybara 3.24.0. Obviously that's a secondary issue, but just noting.

@eileencodes
Copy link
Member

This change isn't correct, however I looked for your specific exception in the Rails issues tracker and got this #36763.

Looks like this was fixed in master and 6.0 in #36949

@maschwenk
Copy link
Contributor Author

@eileencodes 👍🏼 and I appreciate you pointing to the bugfix. Closing, apologies for confusion.

@maschwenk maschwenk closed this Sep 1, 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

3 participants