-
-
Notifications
You must be signed in to change notification settings - Fork 428
Race condition with capybara-webkit and DatabaseCleaner #602
Comments
Active requests are generally terminated when calling On Saturday, December 14, 2013 at 5:36 AM, Miks Miķelsons wrote:
|
Here it is https://gist.github.com/miks/7990167 |
It's possible that something else is running asynchronously. The two that jump out at me from your spec_helper are Sidekiq and and ParallelTests. I haven't tried either of those recently and I'm not sure if there would be any issues. On Monday, December 16, 2013 at 11:48 AM, Miks Miķelsons wrote:
|
I am experiencing the same problem. Placing a |
@miks No. Simply, rspec (2.14.1), capybara (2.1.0), capybara-webkit (1.0.0). |
Actually it's very simply to recreate this error. Just add continuous ajax content loading (for example: call function itself to load data one more time on successful ajax request). |
Ok, it's due to fact that capybara "after" hook (defined within gem) is called after all other after hooks described within project (spec_helper.rb). Just add "Capybara.reset_sessions!" before database cleanup:
|
We have js functionality that calls load json on page load.
It's making problem when DatabaseCleaner is cleaning database in rspec "after" hook while capybara-webkit is still somehow active and doing request to controller.
We have hook like this, but it not working correctly all the times as sometimes json loading happpen even after this hook.
Question: is there some way to tell capybara-webkit to stop all request or even close tab/window after test is finished?
The text was updated successfully, but these errors were encountered: