You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(load-test): stabilize auth load testing and K8s local setup
This commit introduces several adjustments to enable local load testing without saturating local resources or hitting false negatives.
### Auth Service
- **Async BCrypt:** Wrapped all `bcrypt` hashing operations in `tokio::task::spawn_blocking` to prevent CPU-bound tasks from blocking the tokio runtime under high concurrency.
- **Dynamic Cost:** Lowered the BCrypt cost to `4` when `MODE=development` to prevent CPU starvation on local machines during heavy load tests, while defaulting to `10` in production.
- **OTP Debug Store:** Exposed `/api/auth/debug/otp-store` strictly in development mode to allow `k6` scripts to fetch OTPs in memory and provision users dynamically.
### URL Service
- **Cache Fix:** Migrated from Moka's `get_with` to `try_get_with` in `get_original_url` to ensure transient database errors aren't incorrectly cached as 404s.
### K8s & Infrastructure
- **Ingress:** Temporarily dropped the `limit-rps` annotation to prevent rate limits from interfering with raw load test measurements, and improved path routing.
- **ConfigMap:** Flipped the default MODE to `development`.
- **k8s.sh Deploy Script:** Added image caching commands to preload third-party dependencies (Postgres, Redis, RabbitMQ, Jaeger) into `kind`, dramatically reducing local cluster boot times. Changed wait checks to wait on deployments instead of individual pods.
### Load Tests (k6)
- **auth.js:** Added a new load test explicitly for stressing the login and token generation endpoints, ensuring SLI adherence.
- **redirects.js & shorten.js:** Adjusted test setups to autonomously provision VUs utilizing the new development OTP endpoint, generating valid JWTs for the tests.
0 commit comments