Skip to content

speedup pytest collection#37977

Open
hypery11 wants to merge 1 commit intocommaai:masterfrom
hypery11:pytest-collection
Open

speedup pytest collection#37977
hypery11 wants to merge 1 commit intocommaai:masterfrom
hypery11:pytest-collection

Conversation

@hypery11
Copy link
Copy Markdown

@hypery11 hypery11 commented May 7, 2026

Removes a few sources of unnecessary work during pytest --collect-only:

  • Convert conftest.py's collect_ignore_glob (selfdrive/debug, selfdrive/modeld) and collect_ignore (process_replay tests) into directory/file --ignore entries on addopts. --ignore skips walking the tree entirely; collect_ignore_glob still visits every .py to filter it out.
  • Lazy-load the heavy mici/tici dialog imports in test_widget_leaks.py into the test body. The test is @pytest.mark.skip for segfaults so the imports were paying ~136ms (raylib + UI stack) on every collection for nothing.

-n auto --dist=loadgroup deliberately left in addopts so test runs stay parallel.

Local macOS timings are not representative (master segfaults during collection here, our env is missing some Linux deps). Happy to add CI timings if there's a reasonable way to extract them.

Fixes #32611

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 66 passed, 0 errors

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

UI Preview

mici: ⚠️ Videos differ! View Diff Report
big: ⚠️ Videos differ! View Diff Report

@hypery11 hypery11 force-pushed the pytest-collection branch from 842f407 to 613379d Compare May 7, 2026 03:40
@hypery11 hypery11 marked this pull request as ready for review May 7, 2026 04:20
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.

Improve pytest collection time to <1s

1 participant