Skip to content

perf(tests): the startup-import checks share interpreter starts instead of one python per test #1733

Closed

Description

@dan-petty

Split from #1725 (CI time budget), so that this row is one issue delivered by one pull request.

Friction

tests/test_cli_startup_imports.py checks what each command imports at startup by starting a fresh python -c interpreter in each test. That's 62 tests and 70-97s summed, the suite's second most expensive file.

Remedy

  • The checks share interpreter starts: one probe per distinct import set, or one per session that reports every command's imports.
  • Each test still asserts its own command's imports.
  • Every assertion stays.

Acceptance criteria

Revised after measuring. 9 of the file's 63 interpreter starts re-measured a command line another test had measured. A start per command line is itself what the checks measure, and sharing it would need a fork server.

  • Each command line's imports are measured in one interpreter start (63 starts become 54), with every assertion kept.
  • A test still over 5s records its reason in its docstring.
  • uv run devops ci passes.

Activity

  1. added this to the v0.2.38 milestone on Oct 20, 2026
  2. added
    type/test
    priority/p0-critical
    scope/ci
    source/agent
    on Oct 20, 2026
  3. dan-petty commented on Oct 20, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1739, merged into release/v0.2.38 as eced8fb.

    The startup-import checks in tests/test_cli_startup_imports.py start one interpreter per command line. Nine of the file's 63 interpreter starts re-measured a command line another test had already measured. This row was split from #1725's CI time budget.

    4 file(s) changed.

    How it was verified

    Check runs at 0b2bc01:

    • Audit Defect PR Hardening: skipping
    • Prune PR DevContainer Images: pass
    • zizmor: pass
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Service Image: skipping
    • Analyze (python): pass
    • Fail-to-Pass Self-Check: pass
    • Rule Pack Tests: pass
    • Changed-Test Independence: pass
    • Tests & Coverage: pass
    • Fail-to-Pass Check: pass
    • Analyze (actions): pass
    • Static Analysis: pass
    • Dependency Freshness: skipping
    • DevContainer Image: skipping

    Acceptance Criteria of docs/agent/tasks/task-1733-startup-import-probes-once.md:

    No Acceptance Criteria section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p0-criticalscope/cisource/agenttype/test

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions