Opened 4 years ago

Closed 4 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: 0.2.7.6
Severity: Trivial Keywords: testing
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

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 https://github.com/fergus-dall/tor/tree/log_heartbeat_test which calls format_local_iso_time to figure out what to compare against.

Child Tickets

Change History (3)

comment:1 Changed 4 years ago by fergus

Status: newneeds_review

comment:2 Changed 4 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 4 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged!

Note: See TracTickets for help on using tickets.