Change package from 'proxy' to 'main' to match other test files in the
proxy directory. This fixes the package mismatch that prevented tests
from running properly.
Co-Authored-By: Claude <noreply@anthropic.com>
- Use NewAdaptiveRateLimiterWithWindow with 10ms window for fast test execution
- Replace manual lastAdjustment manipulation with proper testWindow variable
- Maintain all existing test scenarios and verifications
- Tests now run faster without sleep calls while maintaining correctness
Co-Authored-By: Claude <noreply@anthropic.com>
Add NewAdaptiveRateLimiterWithWindow constructor for test-only refactor:
- Production code uses NewAdaptiveRateLimiter with default 30s window
- Tests can inject shorter durations (e.g., 100ms) for fast execution
- No behavior changes to production rate limiting logic
Acceptance criteria:
- NewAdaptiveRateLimiterWithWindow accepts configurable window duration
- Production callers continue using default 30s window
- Tests can inject millisecond-scale windows for fast iteration
- No changes to rate limiting logic or defaults
Co-Authored-By: Claude <noreply@anthropic.com>