mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-25 06:35:21 +00:00
test(gormstore): stop the background aggregator in time-series stores
Rollup tests set the worker clock while the background aggregation loop read it, so the race detector failed about one run in ten. These stores now stop the loop, and the tests drive aggregation by hand.
This commit is contained in:
@@ -28,6 +28,8 @@ func newTimeSeriesStore(t *testing.T) *GORMStoreV2 {
|
||||
LogLevel: "silent",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
// Tests drive aggregation by hand and set the worker clock; the background loop would race that write.
|
||||
store.aggregationWorker.Stop()
|
||||
return store
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user