Skip to content

test: Deflake memory estimation test and restore its RSS regression coverage - #2202

Merged
vdusek merged 2 commits into
masterfrom
test/fix-flaky-memory-estimation
Sep 1, 2026
Merged

test: Deflake memory estimation test and restore its RSS regression coverage#2202
vdusek merged 2 commits into
masterfrom
test/fix-flaky-memory-estimation

Conversation

@vdusek

@vdusek vdusek commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

test_memory_estimation_does_not_overestimate_due_to_shared_memory fails intermittently on Linux CI (e.g. this run, ratio 0.52 vs the 0.3 tolerance; previously #1288). The sharing children only map the 100 MB segment and never touch it, so its pages are the coldest in the process tree — under memory pressure the kernel reclaims them first, and every reclaimed page silently leaves the PSS readings that the phase deltas are built from.

Two changes:

  1. The sharing children now fault every page of the shared segment before the measurement. Besides removing the reclaim target, this restores the test's original purpose: untouched mappings never enter RSS either, so the test passed even with PSS unavailable — the exact overcount regression it was written to catch in fix: Use PSS instead of RSS to estimate children process memory usage on Linux #1210. With this change, a forced RSS fallback fails every round by ~11x the tolerance.
  2. A distorted measurement round is retried (up to 3 rounds). Transient reclaim does not repeat identically, while a genuine overcount misses the expectation several times over in every round, so the retries cannot mask it.

Verified by reproducing CI's failure signature locally under cgroup memory pressure (systemd-run -p MemoryHigh= plus a hot-page churner): 2/10 failures before, 0/50 after, 0/40 idle runs, and the forced-RSS regression still fails deterministically.

✍️ Drafted by Claude Code

@vdusek vdusek self-assigned this Aug 31, 2026
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Aug 31, 2026
@github-actions github-actions Bot added this to the 148th sprint - Tooling team milestone Aug 31, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Aug 31, 2026
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.64%. Comparing base (142ec58) to head (f907bd0).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2202      +/-   ##
==========================================
- Coverage   93.74%   93.64%   -0.11%     
==========================================
  Files         181      181              
  Lines       12852    12852              
==========================================
- Hits        12048    12035      -13     
- Misses        804      817      +13     
Flag Coverage Δ
unit 93.64% <ø> (-0.11%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@vdusek
vdusek marked this pull request as ready for review August 31, 2026 08:20
@vdusek
vdusek requested a review from Pijukatel August 31, 2026 08:20
@vdusek
vdusek merged commit f02b007 into master Sep 1, 2026
36 checks passed
@vdusek
vdusek deleted the test/fix-flaky-memory-estimation branch September 1, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants