mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +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:
@ -80,15 +80,15 @@ RSpec.describe CachedCounting do
|
||||
freeze_time
|
||||
d1 = Time.now.utc.to_date
|
||||
|
||||
RailsCacheCounter.perform_increment!("a,a")
|
||||
RailsCacheCounter.perform_increment!("b")
|
||||
20.times { RailsCacheCounter.perform_increment!("a,a") }
|
||||
RailsCacheCounter.perform_increment!("a,a", async: true)
|
||||
RailsCacheCounter.perform_increment!("b", async: true)
|
||||
20.times { RailsCacheCounter.perform_increment!("a,a", async: true) }
|
||||
|
||||
freeze_time 2.days.from_now
|
||||
d2 = Time.now.utc.to_date
|
||||
|
||||
RailsCacheCounter.perform_increment!("a,a")
|
||||
RailsCacheCounter.perform_increment!("d")
|
||||
RailsCacheCounter.perform_increment!("a,a", async: true)
|
||||
RailsCacheCounter.perform_increment!("d", async: true)
|
||||
|
||||
CachedCounting.flush
|
||||
|
||||
|
Reference in New Issue
Block a user