From: Remi Gacogne Date: Wed, 3 Mar 2021 08:31:44 +0000 (+0100) Subject: dnsdist: Make sure the TTD is expired in the cache cleaning unit tests X-Git-Tag: dnsdist-1.6.0-alpha2~1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8a0a4a83694657108f31c6fbaa73636d8005caf;p=thirdparty%2Fpdns.git 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. --- 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); }