Skip to content

ci(coverage): raise RUST_MIN_STACK so llvm-cov coverage runs don't stack-overflow#4346

Merged
M3gA-Mind merged 2 commits into
tinyhumansai:mainfrom
graycyrus:fix/cron-llvmcov-stack-overflow
Jun 30, 2026
Merged

ci(coverage): raise RUST_MIN_STACK so llvm-cov coverage runs don't stack-overflow#4346
M3gA-Mind merged 2 commits into
tinyhumansai:mainfrom
graycyrus:fix/cron-llvmcov-stack-overflow

Conversation

@graycyrus

@graycyrus graycyrus commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

The Rust Core Coverage (cargo-llvm-cov) lane is currently red on main — it SIGABRTs with a stack overflow:

thread 'openhuman::cron::scheduler::tests::run_agent_job_returns_error_without_provider_key' has overflowed its stack
fatal runtime error: stack overflow, aborting

That test (added by #4166) drives the full agent harness. Under cargo-llvm-cov, coverage instrumentation inflates per-frame stack usage, which blows libtest's default ~2 MB per-test-thread stack and aborts the entire coverage run — so the lane fails repo-wide, not just on one PR.

Fix

Set RUST_MIN_STACK=67108864 (64 MB) on both the Rust Core Coverage and Rust Tauri Coverage jobs, so libtest's per-test threads get enough headroom under instrumentation. It's a virtual address reservation only (no real memory cost), and CI-only — no source or test changes.

Why this approach

  • The overflow is an artifact of coverage instrumentation, not a real bug in the test or run_agent_job, so bumping the stack for the instrumented run is the correct, minimal fix (vs. refactoring the harness or the test).
  • Applying it to both coverage jobs prevents the same class of failure on the Tauri shell.

Test plan

  • Workflow YAML validates
    CI verification: this PR's Rust Core Coverage lane should no longer stack-overflow (watching this run).

Surfaced while landing the Meetings redesign (#4308); that PR's own lanes were green — this unrelated coverage breakage was blocking the gate.

Summary by CodeRabbit

  • Chores
    • Updated coverage job settings to allow larger thread stack sizes during test coverage runs, helping prevent stack-related failures and improving CI reliability.

The Rust Core Coverage lane aborts with a stack overflow in
cron::scheduler::tests::run_agent_job_returns_error_without_provider_key
(introduced by tinyhumansai#4166). The test drives the full agent harness; under
cargo-llvm-cov, instrumentation inflates per-frame stack usage enough to
blow libtest's default ~2 MB per-test-thread stack, SIGABRTing the whole
run. Set RUST_MIN_STACK=64MB for both coverage jobs so instrumented test
threads have headroom. CI-only; no source/test changes. Virtual address
reservation only, so no real memory cost.
@graycyrus graycyrus requested a review from a team June 30, 2026 13:26
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9214e3eb-f20e-4f9e-be9a-518903974441

📥 Commits

Reviewing files that changed from the base of the PR and between bd7f2af and 253ff50.

📒 Files selected for processing (1)
  • .github/workflows/pr-ci.yml
📝 Walkthrough

Walkthrough

Adds RUST_MIN_STACK environment variable (64MB) with explanatory comments to the env blocks of both rust-core-coverage and rust-tauri-coverage jobs in the PR CI workflow. No other job logic is changed.

Changes

Rust Coverage CI Stack Size

Layer / File(s) Summary
RUST_MIN_STACK env in coverage jobs
.github/workflows/pr-ci.yml
Sets RUST_MIN_STACK to 64MB in both rust-core-coverage and rust-tauri-coverage job env blocks, with matching comments explaining the stack overflow mitigation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit digs deep, but the stack must not break,
64 megabytes for async tests' sake!
Two coverage jobs, now padded with care,
No overflow panics shall lurk in there.
🐇✨ Hop safely, brave tests, through the async air!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the CI coverage stack-size fix and matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 30, 2026
With the stack-overflow fixed (RUST_MIN_STACK), the coverage job now runs
the entire instrumented test suite end-to-end instead of aborting early —
which exceeds the old 30-min budget. Raise timeout-minutes 30 -> 50. The
last run showed all tests passing (zero overflow) right up to the 30-min
cutoff, so it just needs more wall-time.

@M3gA-Mind M3gA-Mind left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and verified: green CI, correct. Approving. Thanks!

@M3gA-Mind M3gA-Mind merged commit d2162cb into tinyhumansai:main Jun 30, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants