Skip to content

chore(deps): pin pytest below 9.2 - #6255

Open
mday-io wants to merge 2 commits into
SQLMesh:mainfrom
mday-io:ci/pin-pytest-below-9.2
Open

mday-io wants to merge 2 commits into
SQLMesh:mainfrom
mday-io:ci/pin-pytest-below-9.2

Conversation

@mday-io

@mday-io mday-io commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

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.

The experiment in #6254 streamed memory samples to the live log and tried one pin at a time:

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

With pytest 9.2.0 (released 2026-10-27), all four xdist workers grow from about 450 MB to about 3.8 GB within five seconds, before any test runs. That uses the runner's 16 GB, and the runner shuts down. With 9.1.1, memory peaks at about 3.1 GB for the whole run.

This only happens in the BigQuery job. Other jobs on the same main runs also use pytest 9.2.0 with four workers and pass, including style-and-cicd-tests, engine-tests-docker (duckdb), and the Snowflake, Databricks and Athena cloud jobs. So the trigger is pytest 9.2.0 combined with something only the BigQuery job has, probably its extra packages such as bigframes. I haven't confirmed which.

Change

Pin pytest<9.2 in the dev extra, with a comment saying why. The pin is broader than the problem, since every job that installs the dev dependencies gets it, but nothing depends on 9.2.0. Python 3.9 already resolves to pytest 8.4.2, so it's unchanged.

Test Plan

  • ci(bigquery): experiment with pinned dependencies (do not merge) #6254 passed engine-tests-cloud (bigquery) with only pytest==9.1.1 pinned, and ran out of memory when only grpcio or only google-cloud-bigquery was pinned.
  • uv pip compile pyproject.toml --extra dev resolves pytest to 9.1.1 on Python 3.12 and 8.4.2 on Python 3.9.
  • pre-commit run --files pyproject.toml and make fast-test pass locally.

Follow-ups

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable): not applicable, dependency pin only
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

Summary by CodeRabbit

  • Chores
    • Updated the development tooling configuration to limit the allowed pytest version.
    • No changes to app features or behavior are included in this update.

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>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The development dependency changes from unpinned pytest to pytest<9.2. Comments describe high memory use during test collection in the BigQuery cloud-engine job and state when to remove the cap.

Changes: Pytest dependency

Layer / File(s) Summary
Development dependency cap
pyproject.toml
The development dependency now caps pytest below version 9.2. Comments describe the memory issue during BigQuery cloud-engine test collection and when to remove the cap.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other · Severity of issue fixed: Medium

Possibly related PRs

  • SQLMesh/sqlmesh#6246: Adds temporary BigQuery-only diagnostics to the cloud-engine test job investigating the same runner failures.
  • SQLMesh/sqlmesh#6243: Adds temporary diagnostics to the BigQuery cloud-engine job investigating the same memory issue.

Suggested reviewers: stuffbyyuki

Merge Risk: Minimal · up to e2b47

This change caps pytest below 9.2 in the dev extra to avoid out-of-memory failures in the BigQuery cloud-test CI job. It affects only development and CI environments, not runtime behavior for users. It is easily reversible and the removal conditions are documented, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "chore(deps): pin pytest below 9.2" matches the main change, which pins pytest<9.2 in the dev extra of pyproject.toml. It is short, specific, and follows a conventional commit style. It does…
Description check Passed The description follows the template. It has a Description section (Problem and Change), a Test Plan section, and a Checklist. The Description content explains the BigQuery memory issue, the pin, and …
Linked Issues check Passed [#6254] The linked issue is an open experiment 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 exper…
Out of Scope Changes check Passed The PR changes only the dev extra in pyproject.toml. The pin and its explanatory comment match the pin described in the PR objective. The PR does not add the experiment's other pins (google-cloud-bigq…
Full details: Title check

Explanation

The title "chore(deps): pin pytest below 9.2" matches the main change, which pins pytest<9.2 in the dev extra of pyproject.toml. It is short, specific, and follows a conventional commit style. It does not explain the BigQuery reason, but the title does not need to cover every detail.

Full details: Description check

Explanation

The description follows the template. It has a Description section (Problem and Change), a Test Plan section, and a Checklist. The Description content explains the BigQuery memory issue, the pin, and its scope. The checklist is filled in, and the test-coverage item is marked not applicable with a reason. The template's Description heading is covered by the Problem and Change subsections. Everything required is present.

Full details: Linked Issues check

Explanation

[#6254] The linked issue is an open experiment 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. The issue sets a follow-up: if BigQuery passes, identify the pin that matters and open a clean PR with only that pin. This PR does that. The current pyproject.toml, dev extra, pins pytest below 9.2 with a comment that cites #6254 and the pytest 9.2.0 memory growth. The change since the previous review narrows the comment text only. The pytest-only pass and the grpcio and google-cloud-bigquery failures 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.

Full details: Out of Scope Changes check

Explanation

The PR changes only the dev extra in pyproject.toml. The pin and its explanatory comment match the pin described in the PR objective. The PR does not add the experiment's other pins (google-cloud-bigquery, grpcio), CI workflow edits, or diagnostics. The incremental change since the previous review (previous head 54cac31 to head e2b4791) alters comment text, per the commit summary and the raw summary, and does not add code. The repository diff tool could not read changed blobs in this run, so this verdict rests on the supplied summary and the earlier verified whole-PR diff rather than a fresh diff read.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

CI annotation context is incomplete: annotation collection unavailable or limited

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4fb5cc55-e590-467a-be2f-480a5d612e8f
Commits

Reviewing files that changed from the base of the PR and between 54cac31 and e2b4791.

Files selected for processing: 1

  • pyproject.toml
Files skipped from review as they are similar to previous 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.

Signed-off-by: mday-io <mdaytn@gmail.com>
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.

1 participant