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

Doc tests action takes too long #118891

Open
Privat33r-dev opened this issue May 10, 2024 · 2 comments
Open

Doc tests action takes too long #118891

Privat33r-dev opened this issue May 10, 2024 · 2 comments
Labels
docs Documentation in the Doc dir

Comments

@Privat33r-dev
Copy link
Contributor

Issue

Usually doctest's action's [Run documentation doctest1 job takes around 12 minutes2 to execute. Most of this time is taken by the internal framework doctest.py3. The issue is caused by unparallelized execution of tests.

Solution

Since the tests are not interconnected (between different doc files), they can be easily parallelized. I suggest using ProcessPoolExecutor that will be suitable to "bypass" GIL (assuming that tasks are CPU-bound). Github runners have 4 cores available4, so, potentially, it can speed up execution by up to 4 times.

@AlexWaygood @erlend-aasland

Footnotes

  1. https://github.com/python/cpython/blob/7ac933e2609b2ef9b08ccf9c815b682b0e1ede2a/.github/workflows/reusable-docs.yml#L108

  2. https://github.com/python/cpython/actions/runs/8922903843/job/24506021604

  3. https://github.com/python/cpython/blob/main/Lib/doctest.py

  4. https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

@Privat33r-dev Privat33r-dev added the docs Documentation in the Doc dir label May 10, 2024
@erlend-aasland
Copy link
Contributor

Sounds good; do you have a PR ready? :)

@Privat33r-dev
Copy link
Contributor Author

I was waiting for a feedback because I might've missed something :) My schedule is a bit tight lately, but I will try to find a time to implement it (hopefully in a week or two).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants