Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAIL: test_check_restart_timestamps (tests.contrib.openstack.test_deferred_events.DeferredCharmServiceEventsTestCase) #697

Open
freyes opened this issue Apr 22, 2022 · 0 comments

Comments

@freyes
Copy link
Collaborator

freyes commented Apr 22, 2022

running tox -e py38 fails with:

======================================================================
FAIL: test_check_restart_timestamps (tests.contrib.openstack.test_deferred_events.DeferredCharmServiceEventsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/freyes/Projects/charms/charm-helpers/.tox/py38/lib/python3.8/site-packages/mock.py", line 1201, in patched
    return func(*args, **keywargs)
  File "/home/freyes/Projects/charms/charm-helpers/tests/contrib/openstack/test_deferred_events.py", line 326, in test_check_restart_timestamps
    self.assertFalse(clear_deferred_restarts.called)
AssertionError: True is not false

The test case uses the following timestamp https://github.com/juju/charm-helpers/blob/master/tests/contrib/openstack/test_deferred_events.py#L308-L310 which according to the comment it's expected to be interpreted as 'Tue 2021-02-02 10:19:55 UTC', the problem is that check_restart_timestamps() uses datetime.datetime.fromtimestamp() which will use the local timezone, I believe this line should be using datetime.datetime.utcfromtimestamp() instead or adjust the test fixture.

https://github.com/freyes/charm-helpers/blob/master/charmhelpers/contrib/openstack/deferred_events.py#L359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant