fix: unblock first growth report generation

This commit is contained in:
2026-08-21 07:49:04 +08:00
parent e6afaa7a10
commit 927319807b
7 changed files with 67 additions and 14 deletions

View File

@@ -20,6 +20,15 @@ func TestCoordinatorFallsBackToBoundedProcessCounters(t *testing.T) {
if err := coordinator.AllowCreate(context.Background(), 7, now); !errors.Is(err, ErrRateLimited) {
t.Fatalf("third request error=%v", err)
}
if err := coordinator.AllowUncached(context.Background(), 9, "terminal-a", now); err != nil {
t.Fatal(err)
}
if err := coordinator.AllowUncached(context.Background(), 9, "terminal-a", now); !errors.Is(err, ErrRateLimited) {
t.Fatalf("same-terminal uncached error=%v", err)
}
if err := coordinator.AllowUncached(context.Background(), 9, "terminal-b", now); err != nil {
t.Fatalf("another terminal should have an independent uncached quota: %v", err)
}
if err := coordinator.ReserveBudget(context.Background(), MaxProviderRequests, 1600, now); !errors.Is(err, ErrBudgetExhausted) {
t.Fatalf("budget without Redis error=%v", err)
}