aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-08-06 17:42:40 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2018-08-16 09:59:58 +0200
commiteb32d164a7f178a71d9af7fe0c95439e20cf3783 (patch)
tree7f5c2fa6500749c4a27be46384b76b0f8fba7883
parenttests: add failsafe timeout for tests running in fork mode (diff)
downloadefl-eb32d164a7f178a71d9af7fe0c95439e20cf3783.tar.gz
tests: add more info on failsafe timeout
if a test is continually deadlocking then it's useful to know which test is failing to complete Differential Revision: https://phab.enlightenment.org/D6785
-rw-r--r--src/tests/efl_check.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h
index b61bcbbdf8..d1a064943b 100644
--- a/src/tests/efl_check.h
+++ b/src/tests/efl_check.h
@@ -253,6 +253,8 @@ _efl_suite_run_end(SRunner *sr, const char *name)
}
#ifdef HAVE_FORK
+static EINA_UNUSED Eina_Hash *fork_map;
+
EINA_UNUSED static int
_efl_suite_wait_on_fork(int *num_forks, Eina_Bool *timeout)
{
@@ -265,7 +267,10 @@ _efl_suite_wait_on_fork(int *num_forks, Eina_Bool *timeout)
if (pid == timeout_pid)
*timeout = EINA_TRUE;
else
- (*num_forks)--;
+ {
+ eina_hash_del_by_key(fork_map, &pid);
+ (*num_forks)--;
+ }
return ret;
}
#endif
@@ -316,6 +321,8 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
pid = fork();
if (pid > 0)
{
+ if (!fork_map) fork_map = eina_hash_int32_new(NULL);
+ eina_hash_add(fork_map, &pid, etc[i].test_case);
num_forks++;
#ifdef ENABLE_TIMING_INFO
if (timing)
@@ -359,9 +366,16 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
} while (num_forks && (!timeout_reached));
if (timeout_reached)
{
+ Eina_Iterator *it;
+ const char *testname;
+ it = eina_hash_iterator_data_new(fork_map);
timeout_pid = 0;
printf("FAILSAFE TIMEOUT REACHED!\n");
fflush(stdout);
+ EINA_ITERATOR_FOREACH(it, testname)
+ printf("STILL RUNNING: %s\n", testname);
+ fflush(stdout);
+ eina_iterator_free(it);
failed_count++;
}
}
@@ -375,6 +389,8 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
kill(timeout_pid, SIGKILL);
timeout_pid = 0;
}
+ eina_hash_free(fork_map);
+ fork_map = NULL;
#endif
#ifdef ENABLE_TIMING_INFO