mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 10:34:39 +08:00
DEV: stop leaking data into tables during test (#21403)
This amends it so our cached counting reliant specs run in synchronize mode When running async there are situations where data is left over in the table after a transactional test. This means that repeat runs of the test suite fail.
This commit is contained in:
@ -1309,9 +1309,11 @@ RSpec.describe Report do
|
||||
end
|
||||
|
||||
after do
|
||||
CachedCounting.reset
|
||||
ApplicationRequest.disable
|
||||
CachedCounting.disable
|
||||
end
|
||||
|
||||
it "works" do
|
||||
3.times { ApplicationRequest.increment!(:page_view_crawler) }
|
||||
2.times { ApplicationRequest.increment!(:page_view_logged_in) }
|
||||
|
@ -6,7 +6,10 @@ RSpec.describe WebCrawlerRequest do
|
||||
CachedCounting.enable
|
||||
end
|
||||
|
||||
after { CachedCounting.disable }
|
||||
after do
|
||||
CachedCounting.reset
|
||||
CachedCounting.disable
|
||||
end
|
||||
|
||||
it "can log crawler requests" do
|
||||
freeze_time
|
||||
|
Reference in New Issue
Block a user