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
This commit is contained in:
Mike Blumenkrantz 2018-07-17 10:45:15 -04:00 committed by Stefan Schmidt
parent cd3f808725
commit bc7cbaffb5
1 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#ifdef HAVE_FORK
#include <sys/types.h>
#include <sys/wait.h>
#include <Eina.h>
#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)
{