Skip to content

Use --parallel when running tests on CI and in precommit#2666

Merged
niklasmohrin merged 4 commits intoe-valuation:mainfrom
karyon:karyon/parallel-tests
Apr 13, 2026
Merged

Use --parallel when running tests on CI and in precommit#2666
niklasmohrin merged 4 commits intoe-valuation:mainfrom
karyon:karyon/parallel-tests

Conversation

@karyon
Copy link
Copy Markdown
Collaborator

@karyon karyon commented Mar 8, 2026

On my machine, wall clock time for "./manage.py run test" drops from 43 to 20s with 6 threads. More threads increased the overhead for creating databases more than it reduced the time for the actual tests. The github runners only have 4 cores.

On my machine, wall clock time for "./manage.py run test" drops from 43 to 20s with 6 threads. More threads increased the overhead for creating databases more than it reduced the time for the actual tests. The github runners only have 4 cores.
@karyon karyon force-pushed the karyon/parallel-tests branch from 56f709a to 75696fc Compare March 8, 2026 17:45
@karyon karyon force-pushed the karyon/parallel-tests branch from 374970c to e228804 Compare March 9, 2026 08:05
@karyon
Copy link
Copy Markdown
Collaborator Author

karyon commented Apr 5, 2026 via email

Users who would like to override the parallelism can set the
environment variable DJANGO_TEST_PROCESSES.
Copy link
Copy Markdown
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated everything to use auto detection. For environments where this is not appropriate, users can set the DJANGO_TESTS_PROCESSES environment variable to override the auto choice. I think this is a reasonable compromise.

@richardebeling richardebeling changed the title Use --parallel 4 when running tests on CI, 6 in precommit Use --parallel when running tests on CI and in precommit Apr 6, 2026
@niklasmohrin niklasmohrin merged commit d544b10 into e-valuation:main Apr 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants