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

Booting Rails server times out #36

Open
amiel opened this issue Jul 5, 2023 · 0 comments
Open

Booting Rails server times out #36

amiel opened this issue Jul 5, 2023 · 0 comments

Comments

@amiel
Copy link

amiel commented Jul 5, 2023

Hi, I'm trying to use watir-rails with Rails 7.0.6, watir 7.2.2, watir-rails 2.3.0, and watir-rspec 5.0.0.

I was getting this error every time:

Rails Rack application timed out during boot

I did some troubleshooting and found that the application was booting, but the __identify__ middleware was returning a different object_id for @app.object_id. It was not getting called twice, so I'm guessing this is a thread-safety issue. I'm not entirely sure why, but while debugging I found that the problem went away if @app.object_id was accessed after creating the app. My initial changes were printing the object id, but the following change caused it to all work again.

I apologize for the issue without a full reproduction, but I thought I would report this in case anyone else is running in to it.

This is the change that works for me:

--- a/lib/watir/rails.rb
+++ b/lib/watir/rails.rb
@@ -112,6 +112,11 @@ module Watir
             run ::Rails.application
           end
         end.to_app
+
+        # Somehow this fixes everything?
+        @app.object_id
+
+        @app
       end
 
       private
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

1 participant