← Back to Pull requests

Recommend running the test suite in parallel #1917

Merged
harshit-s-gowda merged 1 files (27 lines) on Oct 27, 2026 19:22 UTC
View on GitHub
harshit-s-gowda harshit-s-gowda commented on Oct 03, 2026 15:43 UTC
Author

Summary

  • Recommend parallel test execution with -j0 in the main test-running examples.

  • Apply the recommendation to Unix, macOS, and Windows commands.

  • Remove the duplicate parallel-testing section.
  • Issue

    Closes #1895

    Diff: 27 lines (+16 / -11) across 1 files Reviewer: StanFromIreland Review duration: 34779m
    All Vouch review confidence checks passed
    Residual risk 0.03 = Change Risk (0.23) × (1 − Review Confidence (0.88)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.23 · 27 lines diff across 1 files
    0.23
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.84 · 5 substantive comment(s)
    0.84
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    87%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.199
    Real PR Conversation Timeline
    12 items
    python-cla-bot[bot] python-cla-bot[bot] commented on Oct 03, 2026 15:43 UTC
    Bot

    All commit authors signed the Contributor License Agreement.

    ![CLA signed](https://cla.python.org/)<!-- CLA BOT SIGNING COMMENT DO NOT EDIT -->

    read-the-docs-community[bot] read-the-docs-community[bot] commented on Oct 03, 2026 15:44 UTC
    Bot

    <!-- readthedocs-55693 -->

    Documentation build overview

    📚 CPython devguide | 🛠️ Build #35451980 | 📁 Comparing 519d915509c78c5d4475779950e1e779fb7d4fca against latest (2439c5ff4529531db6773b6d604d0bff8a234385)

    <kbd> &nbsp; 🔍 Preview build &nbsp; </kbd>

    <details open>
    <summary>3 files changed</summary>
    <br>
    <code>±</code> <a href="https://cpython-devguide--1917.org.readthedocs.build/versions/index.html"><code>versions/index.html</code></a><br>
    <code>±</code> <a href="https://cpython-devguide--1917.org.readthedocs.build/developer-workflow/c-api/index.html"><code>developer-workflow/c-api/index.html</code></a><br>
    <code>±</code> <a href="https://cpython-devguide--1917.org.readthedocs.build/testing/run-write-tests/index.html"><code>testing/run-write-tests/index.html</code></a><br>
    </details>

    StanFromIreland StanFromIreland commented on code on Oct 21, 2026 20:13 UTC
    Code Review
    testing/run-write-tests.rst:1
    @@ -139,26 +139,7 @@ But, there are several important notes:
        In other words: if some module does not have ``unittest.main()``, then
        most likely it does not support direct invocation.
     
    -If you have a multi-core or multi-CPU machine, you can enable parallel testing

    Can you please add a section expanding how to run tests not in parallel?

    willingc willingc commented on code on Oct 21, 2026 22:11 UTC
    Code Review
    testing/run-write-tests.rst:1
    @@ -139,26 +139,7 @@ But, there are several important notes:
        In other words: if some module does not have ``unittest.main()``, then
        most likely it does not support direct invocation.
     
    -If you have a multi-core or multi-CPU machine, you can enable parallel testing

    To run tests sequentially, omit -j0 from the command.

    StanFromIreland StanFromIreland commented on code on Oct 27, 2026 12:58 UTC
    Code Review
    testing/run-write-tests.rst:1
    @@ -139,26 +139,7 @@ But, there are several important notes:
        In other words: if some module does not have ``unittest.main()``, then
        most likely it does not support direct invocation.
     
    -If you have a multi-core or multi-CPU machine, you can enable parallel testing

    I pushed such a section.

    StanFromIreland StanFromIreland approved these changes on Oct 27, 2026 12:59 UTC
    Approved Reviewer

    Approved these changes.

    willingc willingc commented on code on Oct 27, 2026 15:45 UTC
    Code Review
    testing/run-write-tests.rst:1
    @@ -139,26 +139,31 @@ But, there are several important notes:
        In other words: if some module does not have ``unittest.main()``, then
        most likely it does not support direct invocation.
     
    -If you have a multi-core or multi-CPU machine, you can enable parallel testing
    -using several Python processes so as to speed up things:
    +By default, ``-j0`` runs tests in parallel using one worker process per CPU,

    @StanFromIreland Is this "one worker process per CPU core"?

    willingc willingc approved these changes on Oct 27, 2026 15:47 UTC
    Approved Reviewer

    Thank you @harshit-s-gowda, and congrats on your first contribution to the devguide.

    @StanFromIreland Please double check my question. Feel free to merge after. Thanks.

    zware zware commented on code on Oct 27, 2026 16:53 UTC
    Code Review
    testing/run-write-tests.rst:1
    @@ -139,26 +139,31 @@ But, there are several important notes:
        In other words: if some module does not have ``unittest.main()``, then
        most likely it does not support direct invocation.
     
    -If you have a multi-core or multi-CPU machine, you can enable parallel testing
    -using several Python processes so as to speed up things:
    +By default, ``-j0`` runs tests in parallel using one worker process per CPU,

    -j0 is actually ((os.process_cpu_count() or 1) + 2) worker processes.

    Rather than trying to specify all of that, maybe just something like

    By default, ``-j0`` runs tests in parallel using a number of worker processes based on available CPU core count,
    

    willingc willingc commented on code on Oct 27, 2026 19:13 UTC
    Code Review
    testing/run-write-tests.rst:1
    @@ -139,26 +139,31 @@ But, there are several important notes:
        In other words: if some module does not have ``unittest.main()``, then
        most likely it does not support direct invocation.
     
    -If you have a multi-core or multi-CPU machine, you can enable parallel testing
    -using several Python processes so as to speed up things:
    +By default, ``-j0`` runs tests in parallel using one worker process per CPU,

    Thanks @zware for the clarification. I like the suggested wording too.

    StanFromIreland StanFromIreland commented on Oct 27, 2026 19:23 UTC
    Contributor

    Merged, thanks all!

    Assignees
    harshit-s-gowda harshit-s-gowda
    Labels
    risk: low confidence: 87.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 22.9% (LOW) · Higher = larger blast radius
    22.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 87.9% · Lower = rushed or shallow review
    87.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 2.8% · Safe to merge
    2.8%