Opened 5 months ago

Closed 5 months ago

#26014 closed defect (fixed)

Fix two cases of nondeterminism in voting_schedule.c coverage

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-ci, tor-tests-coverage, tor-tests-unit
Cc: Actual Points:
Parent ID: #25908 Points:
Reviewer: dgoulet Sponsor: Sponsor3-can

Description

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.

Child Tickets

Change History (4)

comment:1 Changed 5 months ago by nickm

Milestone: Tor: 0.3.5.x-finalTor: 0.3.4.x-final
Owner: set to nickm
Status: newaccepted

comment:2 Changed 5 months ago by nickm

Status: acceptedneeds_review

See branch ticket26014; PR at https://github.com/torproject/tor/pull/88

comment:3 Changed 5 months ago by dgoulet

Reviewer: dgoulet
Status: needs_reviewmerge_ready

lgtm;

comment:4 Changed 5 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Merged to master!

Note: See TracTickets for help on using tickets.