feat(py): use the sysmon coverage core on Python 3.12+ - #1534
xangcastle wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
✨ Aspect Workflows Tasks📅 Tue Sep 8 19:38:36 UTC 2026 ✅ 44 successful tasks
⏱ Last updated Tue Sep 8 19:56:34 UTC 2026 · 📊 GitHub API quota 1,309/15,000 (9% used, resets in 23m) |
py_binary startup benchmark
sys.path quality
Bazel analysis benchmark
py_image_layer benchmark
|
What
start_coverage()now drives coveragepy through a per-process rcfile instead of constructor kwargs, which lets it:core = sysmon(thesys.monitoring/ PEP 669 backend) on Python 3.12+, falling back to coveragepy's default core on older interpreters;data_fileunderTEST_TMPDIR, so shards orchdirtests running concurrently out of one directory no longer race on the default.coveragedatabase.write_lcov()additionally toleratescoverage.exceptions.NoSourcealongsideNoDataError, writing an empty LCOV rather than failing an otherwise passing test.Why
The
sysmoncore is markedly cheaper than the C tracer underbazel coverage. In a large monorepo consuming these rules the same change (carried as a local patch against the pre-launcher_envtemplate) cut wall-clock of instrumentedpy_pytest_testtargets by roughly a quarter to a third relative to the default core, across tests ranging from a few seconds to half a minute.coveragepy only exposes the core choice through configuration (
[run] core), hence the rcfile.Notes for review
NoSourcetolerance mirrors the downstream patch. It is debatable upstream since it can hide a genuinely broken manifest; happy to drop it into a separate PR if preferred.e2e/cases/coverage-driversruns on 3.10, 3.11 and 3.12 and should cover both branches of the version gate. Not run locally yet; relying on CI.sysmonneeds coveragepy >= 7.4.0; the e2e lock pins 7.15.2.