Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multithreaded notebook checks #1026

Merged
merged 6 commits into from
Sep 12, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ jobs:
pip install ${{ matrix.dependencies }}
- name: Check notebooks
run: |
checks/pytest_.py --notebook ${{ matrix.pattern }}
checks/pytest_.py --notebook ${{ matrix.pattern }} -v

docs:
name: Build docs
Expand Down
11 changes: 10 additions & 1 deletion checks-superstaq/checks_superstaq/pytest_.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,16 @@ def run(
if not files:
return 0

if (
if parsed_args.notebook:
# These tests spend most of their time waiting for the server, so allow more threads than we
# have physical processors (within reason)
nthreads = min(len(files), 16)
nthreads = 0 if nthreads <= 1 else nthreads

# Setting before other args so -n can be overwritten
args_to_pass = [f"-n{nthreads}", *args_to_pass]

elif (
not parsed_args.files
and not parsed_args.single_core
and parsed_args.revisions is None
Expand Down