]> git.ipfire.org Git - thirdparty/pdns.git/commit
rec: Don't mix time() and gettimeofday() in our unit tests (again) 7884/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 7 Jun 2019 08:46:58 +0000 (10:46 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 7 Jun 2019 08:46:58 +0000 (10:46 +0200)
commitd0add506df4075aa8a7e2eb7c66f58ea850ff6d4
treea72c93c26f92d6013cf578b6fb1043c67e633101
parent535696c99c7f525d6f2bc586a3196b4e02af171a
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.
pdns/recursordist/test-syncres_cc9.cc