Stabilize metrics rollup chunk proof
Some checks are pending
Build and Test / Secret Scan (push) Waiting to run
Build and Test / Frontend & Backend (push) Waiting to run

Keep the bounded rollup test inside raw retention and wait for startup maintenance before seeding source rows.
This commit is contained in:
rcourtman 2026-07-03 21:57:14 +01:00
parent 3dfac7df16
commit 5e9a94d375

View file

@ -277,9 +277,13 @@ func TestStoreRollupTierMultiResource(t *testing.T) {
func TestStoreRollupTierUsesBoundedChunkBudget(t *testing.T) {
dir := t.TempDir()
chunkWindow := rollupChunkWindow(time.Minute)
sourceWindow := time.Duration(maxRollupChunksPerRun+4) * chunkWindow
cfg := DefaultConfig(dir)
cfg.DBPath = filepath.Join(dir, "metrics-rollup-chunks.db")
cfg.FlushInterval = time.Hour
cfg.RetentionRaw = sourceWindow + 20*time.Minute
store, err := NewStore(cfg)
if err != nil {
@ -287,8 +291,11 @@ func TestStoreRollupTierUsesBoundedChunkBudget(t *testing.T) {
}
defer store.Close()
chunkWindow := rollupChunkWindow(time.Minute)
base := time.Now().UTC().Add(-24 * time.Hour).Truncate(time.Minute)
if err := store.WaitForMaintenance(5 * time.Second); err != nil {
t.Fatalf("wait for startup maintenance: %v", err)
}
base := time.Now().UTC().Add(-sourceWindow).Truncate(time.Minute)
batch := make([]WriteMetric, 0, maxRollupChunksPerRun+1)
for i := 0; i <= maxRollupChunksPerRun; i++ {
batch = append(batch, WriteMetric{