Unitest failing with python 3.8

Bug #1861506 reported by Sahid Orentino
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Incomplete
Undecided
Unassigned

Bug Description

Some unit tests are failing with python3.8 environment.

======================================================================
FAIL: cinder.tests.unit.test_hacking.HackingTestCase.test_logging_format_args
cinder.tests.unit.test_hacking.HackingTestCase.test_logging_format_args
----------------------------------------------------------------------
testtools.testresult.real._StringException: pythonlogging:'': {{{
2020-01-31 14:42:00,196 INFO [keystonemiddleware.auth_token] Starting Keystone auth_token middleware
2020-01-31 14:42:00,200 WARNING [keystonemiddleware._common.config] The option "auth_url" is not known to keystonemiddleware
2020-01-31 14:42:00,201 WARNING [keystonemiddleware.auth_token] AuthToken middleware is set with keystone_authtoken.service_token_roles_required set to False. This is backwards compatible but deprecated behaviour. Please set this to True.
2020-01-31 14:42:00,204 WARNING [keystonemiddleware.auth_token] Configuring www_authenticate_uri to point to the public identity endpoint is required; clients may not be able to authenticate against an admin endpoint
}}}

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/cinder/tests/unit/test_hacking.py", line 176, in test_logging_format_args
    self._assert_has_errors(code.format(method), checker,
  File "/<<PKGBUILDDIR>>/cinder/tests/unit/test_hacking.py", line 152, in _assert_has_errors
    self.assertEqual(expected_errors or [], actual_errors)
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: [(4, 21, 'C310')] != [(4, 20, 'C310')]

======================================================================
FAIL: cinder.tests.unit.test_hacking.HackingTestCase.test_opt_type_registration_args
cinder.tests.unit.test_hacking.HackingTestCase.test_opt_type_registration_args
----------------------------------------------------------------------
testtools.testresult.real._StringException: pythonlogging:'': {{{
2020-01-31 14:42:06,075 INFO [keystonemiddleware.auth_token] Starting Keystone auth_token middleware
2020-01-31 14:42:06,080 WARNING [keystonemiddleware._common.config] The option "auth_url" is not known to keystonemiddleware
2020-01-31 14:42:06,080 WARNING [keystonemiddleware.auth_token] AuthToken middleware is set with keystone_authtoken.service_token_roles_required set to False. This is backwards compatible but deprecated behaviour. Please set this to True.
2020-01-31 14:42:06,083 WARNING [keystonemiddleware.auth_token] Configuring www_authenticate_uri to point to the public identity endpoint is required; clients may not be able to authenticate against an admin endpoint
}}}

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/cinder/tests/unit/test_hacking.py", line 205, in test_opt_type_registration_args
    self._assert_has_errors(code, checker,
  File "/<<PKGBUILDDIR>>/cinder/tests/unit/test_hacking.py", line 152, in _assert_has_errors
    self.assertEqual(expected_errors or [], actual_errors)
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = [(1, 18, 'C311'), (2, 19, 'C311'), (3, 19, 'C311'), (4, 19, 'C311')]
actual = [(1, 18, 'C311'), (2, 18, 'C311'), (3, 19, 'C311'), (4, 18, 'C311')]

Revision history for this message
Sahid Orentino (sahid-ferdjaoui) wrote :

This test is also failing with py38

cinder.tests.unit.volume.drivers.dell_emc.unity.test_client.ClientTest.test_delete_host_wo_lock
-----------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/home/sahid/merge/cinder/.tox/py38/lib/python3.8/site-packages/mock/mock.py", line 1330, in patched
        return func(*args, **keywargs)
      File "/home/sahid/merge/cinder/cinder/tests/unit/volume/drivers/dell_emc/unity/test_client.py", line 651, in test_delete_host_wo_lock
        self.assertRaises(ex.HostDeleteIsCalled,
      File "/usr/lib/python3.8/unittest/case.py", line 816, in assertRaises
        return context.handle('assertRaises', args, kwargs)
      File "/usr/lib/python3.8/unittest/case.py", line 202, in handle
        callable_obj(*args, **kwargs)
    TypeError: 'NoneType' object is not callable

Revision history for this message
Corey Bryant (corey.bryant) wrote :

I'm no longer seeing these errors in victoria builds.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Going to move this to incomplete for now unless it pops up again. I'm assuming it's been fixed upstream.

Changed in cinder:
status: New → Incomplete
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.