]> git.ipfire.org Git - thirdparty/pdns.git/commit
rec: Don't mix time() and gettimeofday() in our unit tests (again) 7931/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 7 Jun 2019 08:46:58 +0000 (10:46 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 14 Jun 2019 11:27:22 +0000 (13:27 +0200)
commit8aa7468d906ca45380fbaa17376eece512d44d1d
treea311cc94a0387f5d49b59e43fe3694b1d23bbeaf
parentc7871d61ca3da29cda03e44e9485d79674266ba9
rec: Don't mix time() and gettimeofday() in our unit tests (again)

We used to set time returned by `sr->getNow()` via `gettimeofday()`
and later the one used to compute the RRSIG validity via
`time(nullptr)`. It turns out that the second call can return a
value lesser than the first one, without the time going backward,
making our tests fail.
After this commit we base our calculations on the same time value,
so it should not fail randomly anymore.

(cherry picked from commit d0add506df4075aa8a7e2eb7c66f58ea850ff6d4)
pdns/recursordist/test-syncres_cc9.cc