feat: allow for parallel execution of make eunit sub-targets#5808
Merged
feat: allow for parallel execution of make eunit sub-targets#5808
make eunit sub-targets#5808Conversation
This is in preparation for using parallel make features. Since both .PHONY couch and src/couch exist, the parallising of src/* would clobber the top level .PHONY couch target.
When called with -jN for N>1, make will run `rebar -r eunit` for
all src/* Erlang apps (without the default skipped ones) up to the
limit of N times in parallel.
This is best used with GNU Make, as it allows for controlling the
output of each subtask to be grouped. BSD Make has no such feature
and interleaves all parallel target’s output, making it hard to
read.
For example:
gmake -j2 --output-sync=target
will run two test suites in parallel and keep their respective
outputs separated. It does this by buffering all output before a
task is done that means for the first few tests, you don’t see
output as you do with serial execution.
On my machine I can run up to -j6 relatively stable, making use
of all 14 cores. Beyond that, Spurious errors can occur. I’ll
file those separately.
-j2 shows an almost 2x speed improvement, as expected and things
scale relatively linarly up until ~2.5 minutes of runtime, which
seems to be a lower bound with all our various setup and wait
bits.
For comparison, -j1, that is serial execution takes about 10.5
minutes on this machine.
Use with care in CI, but definitely use on your local dev machine.
…tion of a shards db
This is achived by configuring each couch_server launched with separate etc, data and log directories. These directories are cleaned up after successful test runs.
Open
big-r81
requested changes
Dec 6, 2025
Contributor
big-r81
left a comment
There was a problem hiding this comment.
I think we should add the changes to the Makefile.win file too, because if we do the next release, this will fail on Windows ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: allow for parallel execution of
make eunitsub-targetsWhen called with -jN for N>1, make will run
rebar -r eunitforall src/* Erlang apps (without the default skipped ones) up to the
limit of N times in parallel.
This is best used with GNU Make, as it allows for controlling the
output of each subtask to be grouped. BSD Make has no such feature
and interleaves all parallel target’s output, making it hard to
read.
For example:
will run two test suites in parallel and keep their respective
outputs separated. It does this by buffering all output before a
task is done that means for the first few tests, you don’t immediately
see output as you do with serial execution.
On my machine I can run up to -j6 relatively stable, making use
of all 14 cores. Beyond that, Spurious errors can occur. I’ll
file those separately.
-j2 shows an almost 2x speed improvement, as expected and things
scale relatively linarly up until ~2.5 minutes of runtime, which
seems to be a lower bound with all our various setup and wait
bits.
For comparison, -j1, that is serial execution takes about 10.5
minutes on this machine.
Use with care in CI, but definitely use on your local dev machine.
Internally, this is achieved by configuring each couch_server launched
with separate etc, data and log directories. These directories
are cleaned up after successful test runs.
In addition,
nouveau/had to be moved toextra/nouveauto avoiddynamic make target clobbering.
This work is in accordance with M1 of the Sovereign Tech Agency
Statement of Work.