From be659436e489ff3db62df2d2689e1365ed99739d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 12 Jul 2018 15:28:54 +0100 Subject: [PATCH 17/18] Don't do OOM testing under valgrind by default It's just painfully slow, particularly when we fork (as we do in test-bus to test service activation). Signed-off-by: Simon McVittie --- dbus/dbus-internals.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 061c527b..b1c89520 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -1056,6 +1056,7 @@ _dbus_test_oom_handling (const char *description, description, approx_mallocs); setting = _dbus_getenv ("DBUS_TEST_MALLOC_FAILURES"); + if (setting != NULL) { DBusString str; @@ -1071,6 +1072,14 @@ _dbus_test_oom_handling (const char *description, max_failures_to_try = 4; } + if (RUNNING_ON_VALGRIND && _dbus_getenv ("DBUS_TEST_SLOW") == NULL) + { + /* The full OOM testing is slow, valgrind is slow, so the + * combination is just horrible. Only do this if the user + * asked for extra-slow tests. */ + max_failures_to_try = 0; + } + if (max_failures_to_try < 1) { _dbus_test_diag ("not testing OOM handling"); -- 2.18.0