summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-17 10:45:15 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2018-07-25 09:50:11 +0200
commitbc7cbaffb5f6bc0dfcc435b2d16f2d3be03d40b1 (patch)
tree9327b23a60836b05234c31989cf36faf06bab47d
parentcd3f8087252063915b9ef80aa2e78f5627ed9f80 (diff)
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
-rw-r--r--src/tests/efl_check.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h
index 0e65554..1d9942f 100644
--- a/src/tests/efl_check.h
+++ b/src/tests/efl_check.h
@@ -15,6 +15,7 @@
15#ifdef HAVE_FORK 15#ifdef HAVE_FORK
16#include <sys/types.h> 16#include <sys/types.h>
17#include <sys/wait.h> 17#include <sys/wait.h>
18#include <Eina.h>
18#endif 19#endif
19 20
20#ifndef EINA_UNUSED 21#ifndef EINA_UNUSED
@@ -277,6 +278,16 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
277#ifdef HAVE_FORK 278#ifdef HAVE_FORK
278 if (do_fork && can_fork) 279 if (do_fork && can_fork)
279 { 280 {
281 if (num_forks == eina_cpu_count())
282 {
283 do
284 {
285 int status = 0;
286 waitpid(0, &status, 0);
287 failed_count += WEXITSTATUS(status);
288 num_forks--;
289 } while (0);
290 }
280 pid = fork(); 291 pid = fork();
281 if (pid > 0) 292 if (pid > 0)
282 { 293 {