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

Enable parallel testing in CI #379

Closed
jbergstroem opened this issue Apr 5, 2016 · 2 comments
Closed

Enable parallel testing in CI #379

jbergstroem opened this issue Apr 5, 2016 · 2 comments

Comments

@jbergstroem
Copy link
Member

A bunch of people has helped out improving running the test suite in parallel
(refs: nodejs/node#4476). What left to be done now is to roll it out in CI. The tricky part here is that passing -j $(prtconf stuff) is that its not cross platform and is plain wrong on some systems (smartos). Passing -J to test.py won't work either since it uses pythons multiprocessing.cpu_count() which similar to /proc/cpu will be way off on some os'es (hi, smartos).

My idea was that we could start rolling out the environment variable JOBS= which would reflect the amount of parallel threads we want a slave to use. If this is found in Makefile (or vcbuild), we pass it to -j $JOBS; otherwise we move on as usual (no -j).

Thoughts? Downsides?

Edit: elaborating on -J in python.

@jbergstroem
Copy link
Member Author

The makefile change would look something like this (in nodejs):

diff --git Makefile Makefile
index 401464c..7e7395b 100644
--- Makefile
+++ Makefile
@@ -167,8 +167,13 @@ test-all: test-build test/gc/node_modules/weak/build/Release/weakref.node
 test-all-valgrind: test-build
        $(PYTHON) tools/test.py --mode=debug,release --valgrind

+
+ifdef JOBS
+TEST_OPTS=-j $(JOBS)
+endif
 test-ci: | build-addons
-       $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=$(FLAKY_TESTS) \
+       $(PYTHON) tools/test.py $(TEST_OPTS) -p tap --logfile test.tap \
+               --mode=release --flaky-tests=$(FLAKY_TESTS) \
                $(TEST_CI_ARGS) addons message parallel sequential

 test-release: test-build

..and we'll do something like JOBS={{ ansible_processor_cores }} or JOBS=$(getconf _NPROCESSORS_ONLN) in init scripts for architectures that detects it properly. For the other ones we'll override.

@jbergstroem
Copy link
Member Author

Landed in node a few days ago: nodejs/node@f49a1d0. The next step is to add JOBS to all build environments.

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

No branches or pull requests

1 participant