Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/run-dep-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/source-dist-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
os: [macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ${{ github.event.inputs.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.python-version }}

Expand Down
12 changes: 11 additions & 1 deletion scripts/ci/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,17 @@ def process_args(args):
test_args += f'--junit-xml={args.junit_xml_path} '
if args.markers:
test_args += f'-m {args.markers} '
test_args += '--numprocesses=auto --dist=loadfile --maxprocesses=4 '
if os.getenv('PYTEST_XDIST_AUTO_NUM_WORKERS'):
# If the user set PYTEST_XDIST_AUTO_NUM_WORKERS,
# use that to limit max processes
max_processes = int(os.environ['PYTEST_XDIST_AUTO_NUM_WORKERS'])
elif os.getenv('GITHUB_ACTIONS', 'false') == 'true':
# Limiting parallelism in GitHub, to avoid the
# 'Error: The operation was canceled.' issues in 2026
max_processes=3
else:
max_processes=4
test_args += f'--numprocesses=auto --dist=loadfile --maxprocesses={max_processes} '
Comment on lines +55 to +65
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was thinking that --max-processes would no longer be needed if PYTEST_XDIST_AUTO_NUM_WORKERS was set and the fallback is needed for backwards compatibility if its not set:

Suggested change
if os.getenv('PYTEST_XDIST_AUTO_NUM_WORKERS'):
# If the user set PYTEST_XDIST_AUTO_NUM_WORKERS,
# use that to limit max processes
max_processes = int(os.environ['PYTEST_XDIST_AUTO_NUM_WORKERS'])
elif os.getenv('GITHUB_ACTIONS', 'false') == 'true':
# Limiting parallelism in GitHub, to avoid the
# 'Error: The operation was canceled.' issues in 2026
max_processes=3
else:
max_processes=4
test_args += f'--numprocesses=auto --dist=loadfile --maxprocesses={max_processes} '
test_args += f'--numprocesses=auto --dist=loadfile '
# If the user set PYTEST_XDIST_AUTO_NUM_WORKERS,
# let pytest use that to limit max processes
# Otherwise, fall back to 4 since that's what was
# previously used in this script.
if not os.getenv('PYTEST_XDIST_AUTO_NUM_WORKERS'):
test_args += f'--maxprocesses=4 '

Then it would be specifically set to 3 in the GitHub Actions yaml configurations that run the test suites.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

From discussion, planning to merge this for now since tests are really bad yesterday, we can keep tweaking if there are users setting PYTEST_XDIST_AUTO_NUM_WORKERS.

dirs = " ".join(args.test_dirs)

return runner, test_args, dirs
Expand Down
Loading