mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> <!-- RECURSEML_SUMMARY:START --> ## High-level PR Summary This PR fixes a test in the internal metrics endpoint by replacing a simple wait timer with a more robust retry mechanism. Instead of waiting for a fixed 3000ms delay to allow for asynchronous event logging, the PR implements a `Result.retry` approach that attempts to fetch metrics up to 5 times with exponential backoff, only proceeding when the metrics response differs from the initial state. This change makes the test more reliable by ensuring proper test conditions are met before assertions are made rather than relying on an arbitrary timeout. ⏱️ Estimated Review Time: 5-15 minutes <details> <summary>💡 Review Order Suggestion</summary> | Order | File Path | |-------|-----------| | 1 | `apps/e2e/tests/backend/endpoints/api/v1/internal-metrics.test.ts` | </details> [](https://discord.gg/n3SsVDAW6U) <!-- RECURSEML_SUMMARY:END --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved backend metrics verification with a retry-based approach to handle eventual consistency, reducing test flakiness. * Replaced static waits with structured retries for faster, more reliable execution. * Strengthened assertions on metrics fields (e.g., totals and recent activity) for clearer validation. * Maintains checks to ensure anonymous users remain excluded from metrics. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|---|---|---|
| .. | ||
| backend | ||
| dashboard | ||
| dev-launchpad | ||
| e2e | ||
| mock-oauth-server | ||
| oauth-mock-server | ||