On (19/08/15 20:26), Michal Židek wrote:
Hi!
This is another patch to avoid failing tests
in the CI (make-check-valgrind). This time
the ldap_id_cleanup tests.
Looks like the one second cache timeout was too short
and the tests sometimes failed because they expected the
entries to be still valid for a short while
after they were added to sysdb.
I saw the failures only on Fedora 20 CI machine.
See the attached patch.
Michal
From 35ee376cc0e9674b5fa9ef1c1c3cc3e67152560e Mon Sep 17 00:00:00
2001
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek(a)redhat.com>
Date: Wed, 19 Aug 2015 20:10:28 +0200
Subject: [PATCH] TESTS: ldap_id_cleanup timeouts
The one second timeout interval was sometimes
too short when the tests where running under
Valgrind in the CI and the entries expired
too soon.
---
src/tests/cmocka/test_ldap_id_cleanup.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/tests/cmocka/test_ldap_id_cleanup.c
b/src/tests/cmocka/test_ldap_id_cleanup.c
index 941427e..bdc2568 100644
--- a/src/tests/cmocka/test_ldap_id_cleanup.c
+++ b/src/tests/cmocka/test_ldap_id_cleanup.c
@@ -186,23 +186,26 @@ static void test_id_cleanup_exp_group(void **state)
const char *empty_special_grp = "empty_gr*o/u\\p(2016)";
const char *empty_grp = "empty_grp";
const char *grp = "grp";
+ /* This timeout can be bigger because we will call invalidate_group
+ * to expire entries without waiting. */
+ uint64_t cache_timeout = 30;
It's better to define such variable with const
modifier.
So it cannot be misused for other purposes. (ideally with uppercase name of
variable)
LS