testsuite is sensitive to the local timezone

Bug #1786379 reported by Paul Collins
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Juju Upgrader
Fix Released
Low
Unassigned

Bug Description

[agnew(juju-upgrader)] TZ=UTC make test
python3 -m unittest unit_tests/*.py
................................................................................................................
----------------------------------------------------------------------
Ran 112 tests in 0.079s

OK
[agnew(juju-upgrader)] date -R
Fri, 10 Aug 2018 14:12:39 +1200
[agnew(juju-upgrader)] make test
python3 -m unittest unit_tests/*.py
.....................................................FF.FFF.....................................................
======================================================================
FAIL: test__get_juju_agent_status (unit_tests.test_juju_status.TestJujuStatus)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/paul/build/canonical/juju/juju-upgrader/unit_tests/test_juju_status.py", line 60, in test__get_juju_agent_status
    self.status['applications']['apache2']['units']['apache2/0']), expected_juju_agent_status)
AssertionError: {'current': 'idle', 'since': '04 Jan 2018 0[53 chars]28.0} != {'agent-time': 1515057028.0, 'current': 'id[53 chars]2.8'}
- {'agent-time': 1515053428.0,
? ^^

+ {'agent-time': 1515057028.0,
? ^^

   'current': 'idle',
   'since': '04 Jan 2018 09:10:28Z',
   'version': '2.2.8'}

======================================================================
FAIL: test__get_machines (unit_tests.test_juju_status.TestJujuStatus)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/paul/build/canonical/juju/juju-upgrader/unit_tests/test_juju_status.py", line 50, in test__get_machines
    self.assertEqual(list(juju_status._get_machines(self.status)), expected_machines)
AssertionError: Lists differ: [{'unit': '0', 'current': 'started', 'since': '02 Jan 201[308 chars]WN'}] != [{'unit': '0', 'version': '2.2.8', 'since': '02 Jan 2018 [308 chars]ed'}]

First differing element 0:
{'unit': '0', 'current': 'started', 'since': '02 Jan 201[121 chars]2.8'}
{'unit': '0', 'version': '2.2.8', 'since': '02 Jan 2018 [121 chars]ted'}

- [{'agent-time': 1514920992.0,
? ^^

+ [{'agent-time': 1514924592.0,
? ^^

    'current': 'started',
    'model': 'mojo-dot-canonical-dot-com',
    'model-version': '2.2.8',
    'since': '02 Jan 2018 20:23:12Z',
    'unit': '0',
    'version': '2.2.8'},
- {'agent-time': 1514920992.0,
? ^^

+ {'agent-time': 1514924592.0,
? ^^

    'current': 'started',
    'model': 'mojo-dot-canonical-dot-com',
    'model-version': '2.2.8',
    'since': '02 Jan 2018 20:23:12Z',
    'unit': '1',
    'version': 'UNKNOWN'}]

======================================================================
FAIL: test__get_model_machines (unit_tests.test_juju_status.TestJujuStatus)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/paul/build/canonical/juju/juju-upgrader/unit_tests/test_juju_status.py", line 289, in test__get_model_machines
    self.assertTrue(model in actual_model_machines[index])
AssertionError: False is not true

======================================================================
FAIL: test__get_unit (unit_tests.test_juju_status.TestJujuStatus)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/paul/build/canonical/juju/juju-upgrader/unit_tests/test_juju_status.py", line 85, in test__get_unit
    self.assertEqual(actual_unit, expected_unit)
AssertionError: {'unit': 'apache2/0', 'current': 'idle', 's[183 chars]2.8'} != {'agent-time': 1515057028.0, 'current': 'id[183 chars]2.8'}
- {'agent-time': 1515053428.0,
? ^^

+ {'agent-time': 1515057028.0,
? ^^

   'current': 'idle',
   'machine': '0',
   'machine-version': '2.2.8',
   'model': 'mojo-dot-canonical-dot-com',
   'model-version': '2.2.8',
   'since': '04 Jan 2018 09:10:28Z',
   'unit': 'apache2/0',
   'version': '2.2.8'}

======================================================================
FAIL: test__get_units (unit_tests.test_juju_status.TestJujuStatus)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/paul/build/canonical/juju/juju-upgrader/unit_tests/test_juju_status.py", line 201, in test__get_units
    self.assertTrue(unit in actual_units)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 112 tests in 0.081s

FAILED (failures=5)
Makefile:12: recipe for target 'test' failed
make: *** [test] Error 1
[agnew(juju-upgrade)] _

Related branches

Paul Gear (paulgear)
Changed in juju-upgrader:
importance: Undecided → Medium
importance: Medium → Low
status: New → Triaged
Haw Loeung (hloeung)
Changed in juju-upgrader:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.