[tracker/sam/ci-4-processes] ci: Run a maximum of 4 tests simultaneously



commit 7966322eee874b5486e2806ac5c10daed93c3b4e
Author: Sam Thursfield <sam afuera me uk>
Date:   Sat Sep 14 15:20:30 2019 +0200

    ci: Run a maximum of 4 tests simultaneously
    
    This is an attempt to deal with the random test failures that sometimes
    appear, e.g. https://gitlab.gnome.org/GNOME/tracker/-/jobs/432429
    
    The CI runners on gitlab.gnome.org report 32 CPU cores, so Meson tries
    to run 32 tests at a time. I guess because our tests are mostly IO
    bound this actually makes things slower and causes random failures.

 .gitlab-ci.yml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f659c6fd9..4754cee55 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,11 +24,12 @@ test-fedora-latest:
       # screenful of junk each time unless we strip these.
       unset $(env|grep -o '^CI_[^=]*')
 
-      su tracker -c 'cd build; meson test --print-errorlogs ${MESON_TEST_EXTRA_ARGS}'
+      # We limit `meson test` to 4 parallel test processes. The default is to
+      # have one test process per CPU, but our tests are mostly IO bound
+      # and we get timeouts and failures if we try to run 32 of them at once.
+      su tracker -c 'cd build; meson test --num-processes=4 --print-errorlogs ${MESON_TEST_EXTRA_ARGS}'
 
   after_script:
-    - |
-      python3 -c 'import multiprocessing; print(f"Meson probably started {multiprocessing.cpu_count()} tests 
in parallel.")'
     - |
       echo "Test suite settings:"
       echo


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]