Skip to content

fix: update run_affected_tests.py to use -n 8#1014

Merged
Aureliolo merged 1 commit intomainfrom
fix/affected-tests-worker-count
Apr 2, 2026
Merged

fix: update run_affected_tests.py to use -n 8#1014
Aureliolo merged 1 commit intomainfrom
fix/affected-tests-worker-count

Conversation

@Aureliolo
Copy link
Copy Markdown
Owner

Summary

The pre-push hook script scripts/run_affected_tests.py had "auto" hardcoded as the xdist worker count (line 160), bypassing the pyproject.toml addopts change from #1013.

This was missed in #1013 because the value was split across two Python list elements ("-n", "auto") rather than a single string "-n auto", so the grep search didn't catch it.

Changes

  • scripts/run_affected_tests.py: Change worker count from "auto" to "8"

Why

Follow-up to #1013. Without this fix, git push still triggers 32 pytest workers via the pre-push hook, causing the same crashes and slowness that #1013 aimed to fix.

The pre-push hook script had 'auto' hardcoded as the xdist worker
count, bypassing the pyproject.toml addopts change from #1013.
Copilot AI review requested due to automatic review settings April 2, 2026 18:57
@Aureliolo Aureliolo merged commit 3ee9fa7 into main Apr 2, 2026
25 of 26 checks passed
@Aureliolo Aureliolo deleted the fix/affected-tests-worker-count branch April 2, 2026 18:58
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview April 2, 2026 18:58 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 74ece18.
Ensure that dependencies are being submitted on PR branches. Re-running this action after a short time may resolve the issue. See the documentation for more information and troubleshooting advice.

Scanned Files

None

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the local pre-push test runner script to align its pytest-xdist worker count with the repository’s configured default parallelism, preventing overly aggressive worker spawning during git push.

Changes:

  • Update scripts/run_affected_tests.py to run unit tests with -n 8 instead of -n auto.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the run_affected_tests.py script to change the pytest worker count from 'auto' to a hardcoded value of 8. The review feedback suggests removing the '-n' flag and its associated value entirely to allow pytest to use the centralized configuration defined in pyproject.toml, thereby avoiding configuration duplication and ensuring that future updates to the worker count are automatically respected.

"unit",
"-n",
"auto",
"8",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This hardcoded value still overrides the pyproject.toml configuration mentioned in the PR description. To avoid configuration duplication and ensure that future updates to the worker count in pyproject.toml are automatically respected, consider removing both the "-n" flag and this value from the command list. This would allow pytest to fall back to the centralized addopts settings as intended by #1013, and also prevents similar issues with grep-based searches in the future. Note: Since I can only comment on modified lines, I am anchoring this to line 160, but the suggestion applies to line 159 as well.

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