Navigation Menu

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

Run the tests in parallel #3777

Merged
merged 3 commits into from Jul 2, 2020
Merged

Run the tests in parallel #3777

merged 3 commits into from Jul 2, 2020

Conversation

thufschmitt
Copy link
Member

Change the way the testsuite runs to make each test a separate make target, allowing to run them in parallel rather than sequentially as we do now.
This causes make installcheck -j$(nproc) to drop from ~4m30 to ~40s on my machine.

To allow that, each test now runs under a different TEST_ROOT (which also ensures that they are truly independant), and runs tests/init.sh first to setup everything

Cause the time needed to run the testsuite to drop from ~4mins to ~40s
Use a fifo pipe to handle the synchronisation between the different
threads rather than relying on delays
Use a fifo pipe to handle the synchronisation between the different
threads rather than relying on delays
@edolstra edolstra merged commit ec5d7cb into NixOS:master Jul 2, 2020
@edolstra edolstra deleted the parallel-tests branch July 2, 2020 14:39
@edolstra
Copy link
Member

edolstra commented Jul 2, 2020

Thanks, awesome :-)

@thufschmitt
Copy link
Member Author

Bleh, this broke OSX tests because the socket path becomes too long on the CI 😒 I'll open a MR to increase its length

@edolstra
Copy link
Member

edolstra commented Jul 2, 2020

I got this running nix-build release.nix -A build.x86_64-linux:

ran test tests/plugins.sh... [FAIL]
    + set -o pipefail
    ++ nix eval '(builtins.anotherNull)' --option setting-set true --option plugin-files '/build/source/tests/plugins/libplugintest*'
    error: --- SysError --- nix
    opening directory '/build/source/tests/plugins/libplugintest*': No such file or directory
    + res=
make: *** [mk/lib.mk:111: tests/plugins.sh.test] Error 1
make: *** Waiting for unfinished jobs....
ran test tests/brotli.sh... [PASS]

@thufschmitt
Copy link
Member Author

Mh nvm, I can't do that, the size is defined in glibc 🤦

I'll just try and shorten a bit the TEST_ROOT

@thufschmitt
Copy link
Member Author

I got this running nix-build release.nix -A build.x86_64-linux:

ran test tests/plugins.sh... [FAIL]
    + set -o pipefail
    ++ nix eval '(builtins.anotherNull)' --option setting-set true --option plugin-files '/build/source/tests/plugins/libplugintest*'
    error: --- SysError --- nix
    opening directory '/build/source/tests/plugins/libplugintest*': No such file or directory
    + res=
make: *** [mk/lib.mk:111: tests/plugins.sh.test] Error 1
make: *** Waiting for unfinished jobs....
ran test tests/brotli.sh... [PASS]

Mh I was indeed missing a dependency.

thufschmitt added a commit to tweag/nix that referenced this pull request Jul 2, 2020
Reuse the pre-existing list rather than the one written as part of NixOS#3777
@thufschmitt thufschmitt mentioned this pull request Jul 2, 2020
@thufschmitt
Copy link
Member Author

#3778 fixes the build.x86_64-linux. I'm not sure how to reliably solve the OSX CI error as it looks like we had a very small margin wrt the maximum socket path length

@Ericson2314
Copy link
Member

Ericson2314 commented Jul 3, 2020

YAY!!!!! Wow, I hindsight I have no idea how I survived the past month without this :) Thanks @regnat!!!

thufschmitt added a commit to tweag/nix that referenced this pull request Jul 3, 2020
Reuse the pre-existing list rather than the one written as part of NixOS#3777
Ericson2314 pushed a commit to obsidiansystems/nix that referenced this pull request Nov 24, 2021
Reuse the pre-existing list rather than the one written as part of NixOS#3777

(cherry picked from commit 5101ed1)
Ericson2314 pushed a commit to obsidiansystems/nix that referenced this pull request Nov 30, 2021
Reuse the pre-existing list rather than the one written as part of NixOS#3777

(cherry picked from commit 5101ed1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants