You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The commit that added
lock_thread (f638085) notes that
> Transaction management is largely ripped straight out of
> test_fixtures.rb in Rails
The commit that adds lock_thread in Rails --
rails/rails@d6466be
-- has some helpful context:
> When a system test starts Puma spins up one thread and Capybara spins
> up another thread. Because of this when tests are run the database
> cannot see what was inserted into the database on teardown. This is
> because there are two threads using two different connections.
> This change uses the statement cache to lock the threads to using a
> single connection ID instead of each not being able to see each other.
So lock_thread exists because there are two different threads -- Puma
and Capybara -- trying to access the same database but not necessarily
seeing the same thing. But! cypress-rails doesn't use Capybara, and more
importantly, it doesn't use tests or a test runner written in Ruby at
all, so there's only _one_ thread trying to use the database. So we
don't need all this thread locking stuff. So let's remove it to make
things more compatible with Rails 7.2.
0 commit comments