From b8a0a4a83694657108f31c6fbaa73636d8005caf Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 3 Mar 2021 09:31:44 +0100 Subject: [PATCH] dnsdist: Make sure the TTD is expired in the cache cleaning unit tests We were using a too small time margin in the test, causing some issues to not be expired when the test takes more than one second to insert the cache entries. Use a one-hour margin instead. --- pdns/test-dnsdistpacketcache_cc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/test-dnsdistpacketcache_cc.cc b/pdns/test-dnsdistpacketcache_cc.cc index 844179a60a..c39a304d11 100644 --- a/pdns/test-dnsdistpacketcache_cc.cc +++ b/pdns/test-dnsdistpacketcache_cc.cc @@ -201,12 +201,12 @@ BOOST_AUTO_TEST_CASE(test_PacketCacheSharded) { BOOST_CHECK_EQUAL(expired, 0U); /* but after the TTL .. let's ask for at most 1k entries */ - auto removed = PC.purgeExpired(1000, now + 7200 + 1); + auto removed = PC.purgeExpired(1000, now + 7200 + 3600); BOOST_CHECK_EQUAL(removed, remaining - 1000U); BOOST_CHECK_EQUAL(PC.getSize(), 1000U); /* now remove everything */ - removed = PC.purgeExpired(0, now + 7200 + 1); + removed = PC.purgeExpired(0, now + 7200 + 3600); BOOST_CHECK_EQUAL(removed, 1000U); BOOST_CHECK_EQUAL(PC.getSize(), 0U); } -- 2.47.2