Opened 5 years ago

Closed 5 years ago

#18039 closed defect (fixed)

Test for log_heartbeat fails in timezones with non-integer offsets

Reported by: fergus Owned by:
Priority: Very Low Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Trivial Keywords: testing
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


The test for log_heartbeat contains the check

/* format_local_iso_time uses local tz, just check mins and secs. */
tt_ptr_op(strstr(va_arg(ap, char *), ":01:00"),
          OP_NE, NULL); /* end_buf */

which assumes that the timezone will only affect the hours. In timezones with half-hour or 15 minute offsets this test will always (incorrectly) fail.

I have a fix at which calls format_local_iso_time to figure out what to compare against.

Child Tickets

Change History (3)

comment:1 Changed 5 years ago by fergus

Status: newneeds_review

comment:2 Changed 5 years ago by teor

Milestone: Tor: 0.2.8.x-final

Oops, sometimes we all struggle with assumptions about timezones!

This fix looks clean and simple to me, let's get it merged!

comment:3 Changed 5 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed


Note: See TracTickets for help on using tickets.