Hi Tucker I was attempting to highlight the problem with using transactions from within your RSpec processes. The server won’t be able to see the contents of the transactions you’ve started from the RSpec thread unless they are committed, or the server shares the thread with RSpec. This is why traditionally when testing with capybara people have had to use truncation based database cleaning.
Cheers Jon Rowe --------------------------- [email protected] jonrowe.co.uk On 4 February 2019 at 22:01, Tucker McKnight wrote: > Hi Jon, > > Thanks for the reply. We're using Puma, so I expect that the server will be > able to handle all of the traffic from the concurrent tests. And you're right > about why we're using multiple databases: our tests aren't written to avoid > conflicts. We're relying on multiple databases to avoid conflicts. > > Could you go into more detail as to why using one server would be an issue > with transactions? Each rspec thread exists outside of the server thread, but > since the rspec threads are the ones that start and stop transactions, I > don't understand why having only one server would be an issue. One database > would be blocked on a transaction, but when the server receives another > request on a different subdomain, it will change the ActiveRecord config to > use a different database, and that different database would not be blocked by > a transaction. > > I could be misunderstanding how this process works, as I'm not really an > expert in ActiveRecord or database transactions. Does what I'm saying make > sense? > > On Friday, February 1, 2019 at 4:08:28 AM UTC-7, Jon Rowe wrote: -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/dejalu-217-8f699334-4a18-4b91-80ea-67fdd2320fad%40jonrowe.co.uk. For more options, visit https://groups.google.com/d/optout.
