Skip to content

ci: a sysmon check, not a 30-minute cap, catches the coverage fallback - #771

Merged
fas89 merged 1 commit into
mainfrom
ci/coverage-timeout-headroom
Oct 30, 2026
Merged

fas89 merged 1 commit into
mainfrom
ci/coverage-timeout-headroom

Conversation

@fas89

@fas89 fas89 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

What

The coverage job's timeout goes back from 30 to 45 minutes, and a new step fails the job in about a second when coverage.py would not measure with sys.monitoring.

Why

#770 set 30 minutes so that a silent fallback to the C tracer (~40 min) would fail instead of only slowing CI. GitHub enforces a job timeout server-side. On main at 8d8c64b the job's log shows 30500 passed, 1055 skipped ... in 1167.54s (0:19:27), every coverage gate passing, and the Codecov upload and post-job cleanup done at 17:45:51. GitHub never registered those step updates and cancelled the job at 17:54:36 for exceeding 30 minutes. A Test job in the same run lagged the same way: its log ended at 17:44:24 and its completion registered at 17:48:55. The job itself takes 12–22 minutes, so 45 leaves room for the lag.

The fallback check moves to where it can be exact. coverage.py's --debug=core (since 7.4.2, coveragepy/coveragepy#1747) logs Using core=sysmon or Using core=ctrace. The new step runs a one-line script under this job's COVERAGE_CORE and [tool.coverage.run] config, the inputs pytest-cov's core choice depends on.

Validation

The step's script, extracted from the YAML and run under bash -e:

Interpreter and config Result
Python 3.14, repo config exit 0, Using core=sysmon
Python 3.14, dynamic_context = test_function exit 1, Using core=ctrace, error annotation
Python 3.12, coverage 7.14 exit 1, Using core=ctrace

actionlint is clean and the changed-files detect-secrets hook passes. This PR's own Coverage job runs the new step.

Security: CI config only. No new action, permission, secret or expression interpolation.

The cancelled run on main was re-run (failed jobs only).

#770 cut the coverage job's timeout to 30 minutes so that a fallback to
the C tracer (~40 min) would fail instead of only slowing CI. GitHub
enforces that timeout server-side, and on 8d8c64b it cancelled a run
whose 30500 tests and coverage gates had passed at 21 minutes, after
GitHub stopped registering the job's step updates. 45 minutes leaves
room for that lag.

The fallback is caught by a step instead: coverage.py's --debug=core
logs the core it would use, and the step fails in a second unless it
is sysmon. Same COVERAGE_CORE and [tool.coverage.run] config as the run.
@github-actions github-actions Bot added ci Continuous integration and automation changes needs-docs Pull request needs a linked docs update or justification labels Oct 30, 2026
@github-actions

Copy link
Copy Markdown

📄 Documentation Reminder

This PR appears to be missing a documentation reference. Our docs live in a separate repo.

Please update the PR description with one of:

  • Link a docs PR — check the "Docs PR linked" box and paste the URL
  • Mark as no docs needed — check "No docs needed" with a justification
  • Acknowledge docs TODO — check "Docs TODO" and create the docs PR before merge

See the Contributing Guide for details.

@fas89
fas89 merged commit a715565 into main Oct 30, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration and automation changes needs-docs Pull request needs a linked docs update or justification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant