Skip to content

Should a Puma server started from feature tests on Rails 6 fork from a Spring process? #657

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

Closed
maxwell opened this issue Nov 24, 2021 · 1 comment

Comments

@maxwell
Copy link

maxwell commented Nov 24, 2021

I have a Rails 6 app which uses Spring, and whenever I run a "normal" rspec unit test, my tests run quickly after my first boot of the day.

I've noticed however that when I run a JS enabled system/feature test, the first request to my server always take a boat load (30+ seconds) of time, seemingly when it is rendering the first view. After that first request, the rest of the requests are snappy.

Perhaps I am misunderstanding Spring, but am I wrong to expect that the Capybara.server should be able to fork from a preloaded spring process? Or would I need to somehow tell Capybara that its server is not just my rails app to boot, but also that it is spring-ified?

thanks!

@rafaelfranca
Copy link
Member

The capybara server is not managed by spring. It should be possible to capybara to reuse the spring server but currently there is no code in spring or capybara to do that. I think it depends on how capybara starts the application. If it uses the rails server command it will be able to get the cache.

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

No branches or pull requests

2 participants