diff --git a/.travis.yml b/.travis.yml index 8bcbf70e33..1f3d2d033f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -117,10 +117,10 @@ install: script: - if [[ $TEST_TARGET == 'default' ]]; then - python -m iris.tests.runner --default-tests --system-tests --print-failed-images --num-processors=8; + python -m iris.tests.runner --default-tests --system-tests --print-failed-images --num-processors=3; fi - if [[ $TEST_TARGET == 'example' ]]; then - python -m iris.tests.runner --example-tests --print-failed-images --num-processors=8; + python -m iris.tests.runner --example-tests --print-failed-images --num-processors=3; fi # Capture install-dir: As a test command must be last for get Travis to check diff --git a/lib/iris/tests/runner/_runner.py b/lib/iris/tests/runner/_runner.py index c9406dd64c..340923f370 100644 --- a/lib/iris/tests/runner/_runner.py +++ b/lib/iris/tests/runner/_runner.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2010 - 2016, Met Office +# (C) British Crown Copyright 2010 - 2017, Met Office # # This file is part of Iris. # @@ -127,7 +127,9 @@ def finalize_options(self): if self.stop: print('Stopping tests after the first error or failure') if self.num_processors is None: - self.num_processors = multiprocessing.cpu_count() - 1 + # Choose a magic number that works reasonably well for the default + # number of processes. + self.num_processors = (multiprocessing.cpu_count() + 1) // 4 + 1 else: self.num_processors = int(self.num_processors)