All acceptance criteria verified - TestAdaptiveRateLimiter_BasicBounds already exists and passes with injected window duration. Co-Authored-By: Claude <noreply@anthropic.com>
1.1 KiB
1.1 KiB
Bead bf-32n: Add bounds enforcement tests
Status
Already complete - The required test TestAdaptiveRateLimiter_BasicBounds already exists and passes all acceptance criteria.
Verification
All acceptance criteria met:
- ✅ TestAdaptiveRateLimiter_BasicBounds test function exists (line 982)
- ✅ Table-driven with multiple bound scenarios (4 test cases)
- ✅ Tests use injected window duration (testWindow = 10ms, no sleep calls)
- ✅ Tests verify rate stays in [minRate, maxRate] under all conditions
- ✅ Tests pass:
go test ./proxy -v -run TestAdaptiveRateLimiter_BasicBounds
Scope Coverage
All required scenarios covered:
- ✅ Rate never drops below minRate (default: 10)
- ✅ Rate never exceeds maxRate (default: 100)
- ✅ Heavy 429 load drives rate to min but not below
- ✅ Continuous success drives rate to max but not above
Original Implementation
Test was added in commit 88358f9 ("test(ratelimiter): add basic state and bounds tests for AdaptiveRateLimiter") and improved in commit 22644ea to use injected window duration for faster test execution.
Location: proxy/ratelimiter_test.go:982-1066