test(billing): guard ledger paging by design, not wall-clock time - #4143
Conversation
…ot wall-clock The hardcoded `< 50ms` assertion in the listLedgerPage perf test flaked on shared CI runners under load (86ms observed on a correct build). Replace it with a relative bound: median of several page-1 fetches from a 1000-entry ledger vs a one-page-long ledger, asserted as a ratio with a generous margin. Both fetches slow down together under runner contention, so the ratio stays stable even when absolute wall-clock time doesn't. Closes #3950 Claude-Session: https://claude.ai/code/session_015td7sshifbRrYrHbKgheiR
…nnot flake the ratio
|
Warning Review limit reachedNext included review available in 15 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: pierreb-devkit/Node/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4143 +/- ##
=======================================
Coverage 94.48% 94.48%
=======================================
Files 170 170
Lines 6036 6036
Branches 1946 1947 +1
=======================================
Hits 5703 5703
Misses 271 271
Partials 62 62
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
The ledger page test asserted a fixed
< 50msand flaked on busy CI runners. Timing could not catch the real regression anyway: at 1000 entries, reading the whole document costs about the same as the paged query. The test now asserts the design: page 1 comes from one aggregation that slices server-side, never fromfindOne/find, and returns the right page. Checked by swapping the repository to a full-document read: the test fails. No timing, so no flake. Test only.Closes #3950 · epic #4019
https://claude.ai/code/session_015td7sshifbRrYrHbKgheiR