Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rec backport to 4.2.x: Don't mix time() and gettimeofday() in our unit tests (again) #7931

Merged

Conversation

Projects
None yet
2 participants
@omoerbeek
Copy link
Member

commented Jun 14, 2019

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 d0add50)

Short description

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
  • checked that this code was merged to master
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 d0add50)

@omoerbeek omoerbeek changed the title rec: Don't mix time() and gettimeofday() in our unit tests (again) rec backport to 4.2.x: Don't mix time() and gettimeofday() in our unit tests (again) Jun 14, 2019

@omoerbeek

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2019

including a test of a modified cherry-pick-pr.py

@rgacogne rgacogne added this to the rec-4.2.0 milestone Jun 17, 2019

@rgacogne rgacogne merged commit 1b5ab1d into PowerDNS:rel/rec-4.2.x Jun 17, 2019

17 of 18 checks passed

ci/circleci: test-auth-regress-odbc-mssql Your tests failed on CircleCI
Details
ci/circleci: build-auth Your tests passed on CircleCI!
Details
ci/circleci: build-recursor Your tests passed on CircleCI!
Details
ci/circleci: test-auth-algorithms Your tests passed on CircleCI!
Details
ci/circleci: test-auth-api Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-bind Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-gmysql Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-gpgsql Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-gsqlite3 Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-ldap Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-lmdb Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-mydns Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-odbc-sqlite3 Your tests passed on CircleCI!
Details
ci/circleci: test-auth-regress-tinydns Your tests passed on CircleCI!
Details
ci/circleci: test-recursor-api Your tests passed on CircleCI!
Details
ci/circleci: test-recursor-bulk Your tests passed on CircleCI!
Details
ci/circleci: test-recursor-regression Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@omoerbeek omoerbeek deleted the omoerbeek:backport-7884-to-rel/rec-4.2.x branch Jun 17, 2019

@omoerbeek omoerbeek modified the milestones: rec-4.2.0, rec-4.2.0-rc2 Jun 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.