From f02b62138466c876f6e8d6382769105f2e920d96 Mon Sep 17 00:00:00 2001 From: Michal Židek Date: Wed, 19 Aug 2015 20:10:28 +0200 Subject: 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. Reviewed-by: Petr Cech --- src/tests/cmocka/test_ldap_id_cleanup.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/tests/cmocka/test_ldap_id_cleanup.c') diff --git a/src/tests/cmocka/test_ldap_id_cleanup.c b/src/tests/cmocka/test_ldap_id_cleanup.c index 941427e12..ce7f909d5 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. */ + const uint64_t CACHE_TIMEOUT = 30; struct sysdb_test_ctx *test_ctx = talloc_get_type_abort(*state, struct sysdb_test_ctx); ret = sysdb_store_group(test_ctx->domain, special_grp, - 10002, NULL, 1, 0); + 10002, NULL, CACHE_TIMEOUT, 0); assert_int_equal(ret, EOK); ret = sysdb_store_group(test_ctx->domain, empty_special_grp, - 10003, NULL, 1, 0); + 10003, NULL, CACHE_TIMEOUT, 0); assert_int_equal(ret, EOK); ret = sysdb_store_group(test_ctx->domain, grp, - 10004, NULL, 1, 0); + 10004, NULL, CACHE_TIMEOUT, 0); assert_int_equal(ret, EOK); ret = sysdb_store_group(test_ctx->domain, empty_grp, - 10005, NULL, 1, 0); + 10005, NULL, CACHE_TIMEOUT, 0); assert_int_equal(ret, EOK); ret = sysdb_store_user(test_ctx->domain, "test_user", NULL, -- cgit