Skip to content

test(billing): guard ledger paging by design, not wall-clock time - #4143

Merged
PierreBrisorgueil merged 4 commits into
masterfrom
test/ledger-perf-bound
Sep 27, 2026
Merged

PierreBrisorgueil merged 4 commits into
masterfrom
test/ledger-perf-bound

Conversation

@PierreBrisorgueil

@PierreBrisorgueil PierreBrisorgueil commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

The ledger page test asserted a fixed < 50ms and 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 from findOne/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

…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
@PierreBrisorgueil PierreBrisorgueil added the Tests Adding missing tests or correcting existing label Sep 27, 2026
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: pierreb-devkit/Node/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 316c1e5d-c9d6-48a9-afa1-24324678d51e

📥 Commits

Reviewing files that changed from the base of the PR and between 7842528 and ef1c26b.

📒 Files selected for processing (1)
  • modules/billing/tests/billing.extraBalance.listLedger.perf.integration.tests.js

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.48%. Comparing base (7842528) to head (ef1c26b).
⚠️ Report is 1 commits behind head on master.

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           
Flag Coverage Δ
integration 64.26% <ø> (ø)
unit 79.77% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7842528...ef1c26b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil PierreBrisorgueil changed the title test(billing): relative bound for the ledger page perf test test(billing): guard ledger paging by design, not wall-clock time Sep 27, 2026
@PierreBrisorgueil
PierreBrisorgueil merged commit 383f8ff into master Sep 27, 2026
8 checks passed
@PierreBrisorgueil
PierreBrisorgueil deleted the test/ledger-perf-bound branch September 27, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tests Adding missing tests or correcting existing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔧 Flaky perf test — relax hardcoded <50ms bound on shared runners

1 participant