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

Bug29500 properly mocked monotime #905

Conversation

Labels
None yet
Projects
None yet
3 participants
@mikeperry-tor
Copy link
Contributor

@mikeperry-tor mikeperry-tor commented Apr 5, 2019

No description provided.

Cancel the padding timer by changing order of sent vs recv (sent cancels).
Hopefully this will stop monotime_absolute_usec() from returning 0 on some
platforms in the tests.
Our monotime mocking forces us to call monotime_init() *before* we set the
mocked time value. monotime_init() thus stores the first ratchet value at
whatever the platform is at, and then we set fake mocked time to some later
value.

If monotime_init() gets a value from the host that is greater than what we
choose to mock time at for our unittests, all subsequent monotime_abosolute()
calls return zero, which breaks all unittests that depend on time moving
forward by updating mocked monotime values.

So, we need to adjust our mocked time to take the weird monotime_init() time
into account, when we set fake time.
@coveralls
Copy link

@coveralls coveralls commented Apr 5, 2019

Pull Request Test Coverage Report for Build 4575

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 62.263%

Files with Coverage Reduction New Missed Lines %
src/core/or/circuitpadding.c 2 92.47%
Totals Coverage Status
Change from base Build 4574: 0.0%
Covered Lines: 46182
Relevant Lines: 74173

💛 - Coveralls

@teor2345 teor2345 closed this Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment