#26 Add "-j4" option to "make check" for speeding up.
Closed 3 years ago by vondruch. Opened 3 years ago by jaruga.

file modified
+4 -1
@@ -788,7 +788,7 @@

  # https://github.com/rubygems/rubygems/issues/2388

  DISABLE_TESTS="$DISABLE_TESTS -n !/test_do_not_allow_invalid_client_cert_auth_connection/"

  

- make check TESTS="-v $DISABLE_TESTS"

+ make %{?_smp_mflags} check TESTS="-v $DISABLE_TESTS"

  

  %files

  %license BSDL
@@ -1107,6 +1107,9 @@

  %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec

  

  %changelog

+ * Tue Sep 11 2018 Jun Aruga <jaruga@redhat.com> - 2.5.1-100

+ - Add "-j4" option to "make check" for speeding up.

+ 

  * Mon Sep 03 2018 Vít Ondruch <vondruch@redhat.com> - 2.5.1-100

  - Properly harden package using -fstack-protector-strong.

  

Seeing the upstream test logic, the make task is run with "-jN" in parallel.

https://github.com/ruby/ruby/blob/trunk/.travis.yml#L81-L82

"make -s $JOBS test-all -o exts TESTOPTS='-q --color=never --job-status=normal' RUBY_FORCE_TEST_JIT=1"
"make -s $JOBS test-spec MSPECOPT=-j"

So, I added -jN by the %{?_smp_mflags} to "make check".
The result of total running time on my local mock environment is

a. Before this pull-request ("make check" without "-j4"): 12 minutes 5 seconds
b. This pull-request ("make check" with "-j4"): 9 minutes 25 seconds

So, it looks better for me to add the option.
Please make sure there is a difference of log output between the case a and b.

a.

+ make check 'TESTS=-v  -n !/test_do_not_allow_invalid_client_cert_auth_connection/'
...
# Running tests:
[    1/17377] BufferedSocketTest#test_gets_empty = 0.00 s
...
[17369/17377] YAMLStoreTest#test_yaml_store_files_are_accessed_as_binary_files = 0.24 s
Finished tests in 348.257638s, 49.8740 tests/s, 6496.0815 assertions/s.
17369 tests, 2262310 assertions, 0 failures, 0 errors, 23 skips

b.

+ make -j4 check 'TESTS=-v  -n !/test_do_not_allow_invalid_client_cert_auth_connection/'
...
# Running tests:
TestDelegateClass#test_callee_in_delegator_class = 0.00 s = . 
TestDelegateClass#test_callee_in_simple_delegator = 0.00 s = . 
...
TestProcess#test_waitall = 0.19 s = .
Retrying...
[  1/217] TestIO#test_DATA_binmode = 0.05 s
[  2/217] TestIO#test_advise = 0.00 s
...
[217/217] TestIO#test_write_with_multiple_nonstring_arguments = 0.05 s
Finished tests in 147.542004s, 115.5942 tests/s, 15059.5895 assertions/s.
17055 tests, 2221922 assertions, 0 failures, 0 errors, 49 skips

Though I do not know why total tests are reduced from 17369 to 17055 tests.

How do you think?

I am not sure the "make -jN" is tested enough to be without issues. You provide one example to start with. It is not used on rubyci.org to be more tested. I can just assume there are reasons ...

Okay, I checked the rubyci.org now.
The reason you mentioned makes sense.
Feel free to close this ticket.

Pull-Request has been closed by vondruch

3 years ago