cypress-rails icon indicating copy to clipboard operation
cypress-rails copied to clipboard

Reconnect when the database gets disconnected

Open searls opened this issue 4 years ago • 0 comments

Sometimes when running a test multiple times with the cypress open IDE, the DB connection will die for whatever reason:

2021-01-11 09:10:42 -0500 Rack app ("POST /test_states/database/projects" - (127.0.0.1)): #<ActiveRecord::StatementInvalid: PG::ConnectionBad: connection is closed>

Rather than kill the process and restart, maybe cypress-rails could detect this and attempt to reconnect?

ActiveRecord::Base.connection.reconnect!

searls avatar Jan 11 '21 14:01 searls