From bc7cbaffb5f6bc0dfcc435b2d16f2d3be03d40b1 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 17 Jul 2018 10:45:15 -0400 Subject: [PATCH] tests: limit per-suite forks to cpu count this is mostly fine to thrash the cpus on beefy desktop computers, but it completely destroys travis's wimpy 2cpu/2gb ram configurations and causes all the tests to fail instead, restrict forking to the number of cpus detected and wait until a fork exits before beginning a new one ref T7151 Differential Revision: https://phab.enlightenment.org/D6597 --- src/tests/efl_check.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h index 0e655541ab..1d9942feb3 100644 --- a/src/tests/efl_check.h +++ b/src/tests/efl_check.h @@ -15,6 +15,7 @@ #ifdef HAVE_FORK #include #include +#include #endif #ifndef EINA_UNUSED @@ -277,6 +278,16 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co #ifdef HAVE_FORK if (do_fork && can_fork) { + if (num_forks == eina_cpu_count()) + { + do + { + int status = 0; + waitpid(0, &status, 0); + failed_count += WEXITSTATUS(status); + num_forks--; + } while (0); + } pid = fork(); if (pid > 0) {