Skip to content

Commit

Permalink
Use UTC for the timezone in functional tests
Browse files Browse the repository at this point in the history
The prior code uses the local time zone, in my case
prsently 'PST' which pytz doesn't grok, however it does
grok UTC, and CI runs in UTC, and the API, as far as I know,
conveys in UTC. So this should just be for consistency.

Change-Id: Ia47b6adfc18be54f8e9623b34ef34b66436828dc
  • Loading branch information
juliakreger committed Feb 21, 2023
1 parent 933c4f8 commit 836ba11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ironic_inspector/test/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,10 @@ def check_status(self, status, finished, state, error=None):
error=error),
status
)
# CI Runs in UTC, local machines can fail on the use of the local
# timezone.
curr_time = datetime.datetime.fromtimestamp(
time.time(), tz=pytz.timezone(time.tzname[0]))
time.time(), tz=pytz.timezone('UTC'))
started_at = timeutils.parse_isotime(status['started_at'])
self.assertLess(started_at, curr_time)
if finished:
Expand Down

0 comments on commit 836ba11

Please sign in to comment.