Skip to content

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

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

mday-io wants to merge 1 commit 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.

Change

Pin pytest<9.2 in the dev extra, with a comment saying why. This affects every job that installs the dev dependencies. 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 failed with every pin except that one.
  • 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
    • Limited the development test-tool version to avoid excessive memory use during test collection on CI runners.

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 a stated memory issue during xdist collection and say to remove the cap when a fixed release is available.

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 stated memory issue during xdist collection and when to remove the cap.

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

Change: Other

Suggested reviewers: stuffbyyuki, hdm-db2-eco-system

Merge Risk: Minimal · up to 54cac

This change pins the test dependency pytest below 9.2 to avoid the reported memory blow-up during test collection in CI. It does not affect runtime behavior for users, and no concrete merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "chore(deps): pin pytest below 9.2" matches the single main change in the changeset, which pins pytest<9.2 in the dev extra of pyproject.toml. It is short, specific, and conventional in form…
Description check Passed The description covers the problem, the change, and a test plan with validation steps. It also includes follow-ups and a checklist. It follows the repository template's sections (Description, Test Pla…
Linked Issues check Passed [#6254] The linked issue is an open experiment marked 'do not merge'. Its CI steps (run engine-tests-cloud for this PR, pin three packages in the BigQuery step, print versions, stream samples to the l…
Out of Scope Changes check Passed The whole-PR diff (merge base 1f96a72 to head 54cac31) changes only the dev extra in pyproject.toml, per the supplied summary (+3/-1). The change adds the pytest<9.2 constraint and its explanato…
Full details: Title check

Explanation

The title "chore(deps): pin pytest below 9.2" matches the single main change in the changeset, which pins pytest<9.2 in the dev extra of pyproject.toml. It is short, specific, and conventional in form.

Full details: Description check

Explanation

The description covers the problem, the change, and a test plan with validation steps. It also includes follow-ups and a checklist. It follows the repository template's sections (Description, Test Plan, Checklist). The only gap is that the test-plan checkbox for new tests is left unchecked with a reason given, which is acceptable for a dependency-only pin. The DCO and style checkboxes are present. The template's Description heading is replaced by Problem and Change subsections, which still conveys the required information.

Full details: Linked Issues check

Explanation

[#6254] The linked issue is an open experiment marked 'do not merge'. Its CI steps (run engine-tests-cloud for this PR, pin three packages in the BigQuery step, print versions, stream samples to the live log) apply to that experiment branch only. The issue states the follow-up: if BigQuery passes, narrow down the pin that matters and open a clean PR with only that pin. This PR does that. The reviewed head pyproject.toml, dev extra, contains the single change "pytest&lt;9.2" with a comment that cites #6254 and the memory growth in pytest 9.2.0. The pytest-only result is taken from the #6254 experiment as reported by the author. This assessment does not verify that CI result from the repository. No coding requirement from #6254 is unmet for this PR.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff (merge base 1f96a72 to head 54cac31) changes only the dev extra in pyproject.toml, per the supplied summary (+3/-1). The change adds the pytest&lt;9.2 constraint and its explanatory comment. This directly matches the pin described in the PR objective. The PR does not carry the experiment's other pins (google-cloud-bigquery, grpcio), CI workflow edits, or diagnostics. The repository diff tool could not read changed blobs, so the single-line scope rests on the supplied summary and the head file contents, which show the expected constraint and comment.

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.

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: d05197bb-5664-4422-89d3-a1a53ccd0632
Commits

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

Files selected for processing: 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.

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