Closed mateusg closed 4 years ago
It sounds like you have a timing issue, possibly caused by after test cleanup block order. I am curious why your stacktrace looks like you're mocking part of apparition though.
Closing due to lack of response, way to reproducce
About 6 months ago I replaced capybara-webkit with apparition in an app I'm working on and started seeing this error coming up intermittently in the CI and also locally:
The use of doubles or partial doubles from rspec-mocks outside of the per-test lifecycle is not supported
. According to RSpec's docs, it happens when a stub is created outside of the example context, but I'm not doing that.The backtrace:
If I rerun the same specs with the same seed it might pass or fail. The error doesn't always come from the same test, it can fail randomly on any test. When it causes one failure, it affects also other tests. Apparently database_cleaner ends up committing changes and not clearing the database on such failure.
I've tried updating RSpec to version 3.9, which fixes a thread-safety issue, and apparition to version 0.5.0, but the problem seems to persist. Any clue on what could be causing this? It seems like some kind of thread safety issue.
My app is using: