[tor-bugs] #26014 [Core Tor/Tor]: Fix two cases of nondeterminism in voting_schedule.c coverage

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu May 3 14:02:04 UTC 2018


#26014: Fix two cases of nondeterminism in voting_schedule.c coverage
-------------------------+-------------------------------------------------
     Reporter:  nickm    |      Owner:  (none)
         Type:  defect   |     Status:  new
     Priority:  Medium   |  Milestone:  Tor: 0.3.5.x-final
    Component:  Core     |    Version:
  Tor/Tor                |   Keywords:  tor-ci, tor-tests-coverage, tor-
     Severity:  Normal   |  tests-unit
Actual Points:           |  Parent ID:  #25908
       Points:           |   Reviewer:
      Sponsor:           |
  Sponsor3-can           |
-------------------------+-------------------------------------------------
 After another set of coverage-comparison testing, I found the following to
 cases of nondeterminism in the tests for voting_schedule.c:

 {{{
 --- a/voting_schedule.c.gcov
 +++ b/voting_schedule.c.gcov
 @@ -61,7 +61,7 @@
          -:
          1:  next += offset;
          1:  if (next - interval > now)
 -    #####:    next -= interval;
 +        1:    next -= interval;
          -:
          1:  return next;
          -:}
 }}}

 {{{
 --- a/voting_schedule.c.gcov
 +++ b/voting_schedule.c.gcov
 @@ -52,7 +52,7 @@
          -:
          -:  /* Intervals never cross midnight. */
          1:  if (next > midnight_tomorrow)
 -    #####:    next = midnight_tomorrow;
 +        1:    next = midnight_tomorrow;
          -:
          -:  /* If the interval would only last half as long as it's
 supposed to, then
          -:   * skip over to the next day. */
 }}}

 I think that these changes are probably dependent on using clock time for
 our tests, since they all happened around 0:00 UTC.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26014>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list