You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since 2026-10-31, engine-tests-cloud (bigquery) on main has failed every run. The runner either gets a shutdown signal about a minute into pytest or stops responding until the job is cancelled. Either way, no log or artifact survives.
Importing bigframes.pandas calls sys.setrecursionlimit(10_000_000). SQLMesh's BigQuery adapter imports it when it's installed, and only the BigQuery job installs the bigframes extra.
pytest 9.2.0, released 2026-10-27, added a check during collection that calls inspect.unwrap on every module attribute. On unittest.mock.call, __wrapped__ returns a new _Call each time, so the only limit on unwrap is sys.getrecursionlimit(). With the default of 1000 that costs nothing. With 10,000,000 it allocates until the process runs out of memory.
Several test modules import call at module level, so each xdist worker grows by several GB during collection, before any test runs.
Other jobs also run pytest 9.2.0, but they don't install bigframes, so they pass.
The pin covers every job that installs the dev dependencies, which is broader than the problem, but nothing depends on 9.2.0. Python 3.9 already resolves to pytest 8.4.2, so it's unchanged.
Test Plan
On CI, the experiment in #6254 changed one dependency at a time in the BigQuery job:
Run
google-cloud-bigquery
grpcio
pytest
Result
All three pinned
3.46.2
1.84.0
9.1.1
Passed
grpcio only
3.47.0
1.84.0
9.2.0
Out of memory
google-cloud-bigquery only
3.46.2
1.85.4
9.2.0
Out of memory
pytest only
3.47.0
1.85.4
9.1.1
Passed
Locally, in a Linux container with 4 CPUs and 16 GB, like the GitHub runner, on main at d0c003bb5 with the BigQuery job's install steps and a fake service-account key:
Setup
Peak memory
pytest -n auto -m bigquery, as in CI
Container killed for running out of memory after about 45 s. 16 crashed xdist workers, no test reported.
pytest 9.2.0, --collect-only on tests/integrations/github/cicd/test_github_controller.py
12.5 GB, killed at the memory cap
Same, with the recursion limit set back to 1000 after importing bigframes
320 MB
pytest 9.1.1, same file
318 MB
pytest 9.1.1, full -m bigquery collection
495 MB, 172 tests collected
py-spy on the growing process shows it in FixtureManager._check_for_wrapped_fixture → inspect.unwrap → unittest.mock._Call.__getattr__.
The same thing happens without SQLMesh or bigframes: a conftest.py that calls sys.setrecursionlimit(10_000_000), plus a test file containing from unittest.mock import call, grows by about 2.3 GB per second during collection on pytest 9.2.0. On pytest 9.1.1, or with the default limit, it uses about 40 MB.
pre-commit run --files pyproject.toml passes.
Follow-ups
Remove the pin once a pytest release fixes #15281.
pytest 9.2.0 grows each xdist worker to about 3.8 GB while collecting
tests, which runs the 16 GB CI runners out of memory and kills the
BigQuery cloud engine job. See SQLMesh#6254.
Signed-off-by: mday-io <mdaytn@gmail.com>
This dependency-only change caps pytest below 9.2 for development installs to work around CI runner failures in the BigQuery tests. It does not affect runtime behavior for end users, and no merge-blocking risk is apparent.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "chore(deps): pin pytest below 9.2" matches the single change in the changeset, which constrains the dev dependency pytest to below 9.2 in pyproject.toml. It is concise, specific, and uses a…
Linked Issues check
[#6254] The linked issue is open and marked 'do not merge'. Its experiment steps (CI run for this PR, three pins in the BigQuery step, version printing, live-log sampling) apply to the experiment bran…
Out of Scope Changes check
The whole-PR diff changes one line in pyproject.toml: the dev extra pin pytest<9.2. The pin matches the objective in the PR summary. The PR adds no test, workflow, diagnostic, or other dependency ch…
Description check
The description is thorough and covers the template's core sections. The Description section has a detailed Why and How explaining the pytest 9.2.0 regression (pytest-dev/pytest#15281) that triggers m…
Full details: Title check
Explanation
The title "chore(deps): pin pytest below 9.2" matches the single change in the changeset, which constrains the dev dependency pytest to below 9.2 in pyproject.toml. It is concise, specific, and uses a conventional commit prefix. It does not mention the BigQuery memory issue that motivates the pin, but that is an acceptable level of detail.
Full details: Linked Issues check
Explanation
[#6254] The linked issue is open and marked 'do not merge'. Its experiment steps (CI run for this PR, three pins in the BigQuery step, version printing, live-log sampling) apply to the experiment branch only. Its one follow-up is: if BigQuery passes, identify the pin that matters and open a clean PR with only that pin. The whole-PR diff (merge base 1f96a72 to head e700555) shows one change: "pytest" becomes "pytest<9.2" in the dev extra of pyproject.toml. This PR carries only the pytest pin, not the google-cloud-bigquery or grpcio pins, CI workflow edits, or diagnostics. The pytest-only pass and the failures of the other two pins are author-reported results from #6254. This assessment does not verify them from the repository. No coding requirement from #6254 is unmet for this PR. Note: the whole-PR diff shows no explanatory comment in pyproject.toml, although the PR description and the prior assessment mention one. This does not change the verdict because the comment is not an issue requirement.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff changes one line in pyproject.toml: the dev extra pin pytest<9.2. The pin matches the objective in the PR summary. The PR adds no test, workflow, diagnostic, or other dependency change. The incremental change since the previous review does not add code. The whole-PR diff shows no comment line, which is a documentation gap relative to the PR description. It is not an unrelated change, so it does not make any change out of scope.
Full details: Description check
Explanation
The description is thorough and covers the template's core sections. The Description section has a detailed Why and How explaining the pytest 9.2.0 regression (pytest-dev/pytest#15281) that triggers memory exhaustion in the BigQuery job, and why the pin to pytest<9.2 in the dev extra is the chosen remedy. The Test Plan gives a comparison table of CI experiments, local reproduction results, and a minimal reproduction without SQLMesh or bigframes. The Checklist is present, with the test-addition item marked not applicable and the other items checked. The template's HTML comment placeholders were replaced with content, and the Checklist items match the template. Minor gap: the template's trailing CONTRIBUTING.md reference is not repeated, which is not critical.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: acbe8bdc-ea23-4544-bfd9-338b72647d23
Commits
Reviewing files that changed from the base of the PR and between e2b4791 and e700555.
Files selected for processing: 1
pyproject.toml
Files with no reviewable changes: 1
pyproject.toml
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Why
Since 2026-10-31,
engine-tests-cloud (bigquery)onmainhas failed every run. The runner either gets a shutdown signal about a minute into pytest or stops responding until the job is cancelled. Either way, no log or artifact survives.The cause is a pytest 9.2.0 regression, pytest-dev/pytest#15281, triggered by bigframes:
bigframes.pandascallssys.setrecursionlimit(10_000_000). SQLMesh's BigQuery adapter imports it when it's installed, and only the BigQuery job installs thebigframesextra.inspect.unwrapon every module attribute. Onunittest.mock.call,__wrapped__returns a new_Calleach time, so the only limit onunwrapissys.getrecursionlimit(). With the default of 1000 that costs nothing. With 10,000,000 it allocates until the process runs out of memory.callat module level, so each xdist worker grows by several GB during collection, before any test runs.Other jobs also run pytest 9.2.0, but they don't install bigframes, so they pass.
How
Pin
pytest<9.2in thedevextra. Remove the pin once a pytest release includes a fix for #15281. Two fix PRs are open upstream: pytest-dev/pytest#15283 and pytest-dev/pytest#15315.The pin covers every job that installs the dev dependencies, which is broader than the problem, but nothing depends on 9.2.0. Python 3.9 already resolves to pytest 8.4.2, so it's unchanged.
Test Plan
On CI, the experiment in #6254 changed one dependency at a time in the BigQuery job:
google-cloud-bigquerygrpciopytestgrpcioonlygoogle-cloud-bigqueryonlypytestonlyLocally, in a Linux container with 4 CPUs and 16 GB, like the GitHub runner, on
mainatd0c003bb5with the BigQuery job's install steps and a fake service-account key:pytest -n auto -m bigquery, as in CI--collect-onlyontests/integrations/github/cicd/test_github_controller.py-m bigquerycollectionpy-spyon the growing process shows it inFixtureManager._check_for_wrapped_fixture→inspect.unwrap→unittest.mock._Call.__getattr__.The same thing happens without SQLMesh or bigframes: a
conftest.pythat callssys.setrecursionlimit(10_000_000), plus a test file containingfrom unittest.mock import call, grows by about 2.3 GB per second during collection on pytest 9.2.0. On pytest 9.1.1, or with the default limit, it uses about 40 MB.pre-commit run --files pyproject.tomlpasses.Follow-ups
Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCOSummary by CodeRabbit