Unit test failure when buildnig debian package for Mitaka b3 if dogpile.cache is not 0.5.7

Bug #1552897 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Davanum Srinivas (DIMS)
oslo.cache
Fix Released
High
Davanum Srinivas (DIMS)

Bug Description

When building the Debian package of Nova for Mitaka b3 (ie: Nova 13.0.0~b3), I get the below unit test failures. Please help me to fix this. I'm available on IRC if you need more details and a way to reproduce (but basically, try to build the package in Sid + Experimental using the sources from git clone git://git.debian.org/git/openstack/nova.git).

======================================================================
FAIL: nova.tests.unit.test_cache.TestOsloCache.test_get_client
nova.tests.unit.test_cache.TestOsloCache.test_get_client
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "nova/tests/unit/test_cache.py", line 64, in test_get_client
    expiration_time=60)],
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 969, in assert_has_calls
    ), cause)
  File "/usr/lib/python2.7/dist-packages/six.py", line 718, in raise_from
    raise value
AssertionError: Calls not found.
Expected: [call('oslo_cache.dict', arguments={'expiration_time': 60}, expiration_time=60), call('dogpile.cache.memcached', arguments={'url': ['localhost:11211']}, expiration_time=60), call('dogpile.cache.null', _config_argument_dict=<ANY>, _config_prefix='cache.oslo.arguments.', expiration_time=60, wrap=None), call('oslo_cache.dict', arguments={'expiration_time': 60}, expiration_time=60)]
Actual: [call('oslo_cache.dict', arguments={'expiration_time': 60}, expiration_time=60),
 call('dogpile.cache.memcached', arguments={'url': ['localhost:11211']}, expiration_time=60),
 call('dogpile.cache.null', _config_argument_dict={'cache.oslo.arguments.pool_maxsize': 10, 'cache.oslo.arguments.pool_unused_timeout': 60, 'cache.oslo.arguments.url': ['localhost:11211'], 'cache.oslo.arguments.socket_timeout': 3, 'cache.oslo.expiration_time': 60, 'cache.oslo.arguments.dead_retry': 300, 'cache.oslo.arguments.pool_connection_get_timeout': 10, 'cache.oslo.backend': 'dogpile.cache.null'}, _config_prefix='cache.oslo.arguments.', expiration_time=60),
 call('oslo_cache.dict', arguments={'expiration_time': 60}, expiration_time=60)]

======================================================================
FAIL: nova.tests.unit.test_cache.TestOsloCache.test_get_memcached_client
nova.tests.unit.test_cache.TestOsloCache.test_get_memcached_client
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "nova/tests/unit/test_cache.py", line 120, in test_get_memcached_client
    expiration_time=60, wrap=None)]
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 969, in assert_has_calls
    ), cause)
  File "/usr/lib/python2.7/dist-packages/six.py", line 718, in raise_from
    raise value
AssertionError: Calls not found.
Expected: [call('dogpile.cache.memcached', arguments={'url': ['localhost:11211']}, expiration_time=60), call('dogpile.cache.memcached', arguments={'url': ['localhost:11211']}, expiration_time=60), call('dogpile.cache.null', _config_argument_dict=<ANY>, _config_prefix='cache.oslo.arguments.', expiration_time=60, wrap=None)]
Actual: [call('dogpile.cache.memcached', arguments={'url': ['localhost:11211']}, expiration_time=60),
 call('dogpile.cache.memcached', arguments={'url': ['localhost:11211']}, expiration_time=60),
 call('dogpile.cache.null', _config_argument_dict={'cache.oslo.arguments.pool_maxsize': 10, 'cache.oslo.arguments.pool_unused_timeout': 60, 'cache.oslo.arguments.url': ['localhost:11211'], 'cache.oslo.arguments.socket_timeout': 3, 'cache.oslo.expiration_time': 60, 'cache.oslo.arguments.dead_retry': 300, 'cache.oslo.arguments.pool_connection_get_timeout': 10, 'cache.oslo.backend': 'dogpile.cache.null'}, _config_prefix='cache.oslo.arguments.', expiration_time=60)]

Revision history for this message
Matt Riedemann (mriedem) wrote :

Which version of oslo.cache are you using?

Revision history for this message
Matt Riedemann (mriedem) wrote :

The problem is on the expected call, it expects:

expiration_time=60, wrap=None

In the last call, but it's getting:

expiration_time=60, with no wrap kwarg.

openstack unit tests should be running with oslo.cache 1.4.0:

https://github.com/openstack/requirements/blob/master/upper-constraints.txt#L207

tags: added: debian oslo testing
Revision history for this message
Matt Riedemann (mriedem) wrote :

Actually, which version of dogpile.cache? openstack is using at most 0.5.7:

https://github.com/openstack/requirements/blob/master/upper-constraints.txt#L116

Matt Riedemann (mriedem)
summary: - Unit test failure when buildnig debian package for Mitaka b3
+ TestOsloCache: Unit test failure when buildnig debian package for Mitaka
+ b3
Revision history for this message
Thomas Goirand (thomas-goirand) wrote : Re: TestOsloCache: Unit test failure when buildnig debian package for Mitaka b3

As per IRC chat, I do have version 1.4.0-1 (ie, the latest version, matching upper-constraints.txt). Though dogpile.cache wasn't the latest, it was only 0.5.4. After upgrading it to version 0.5.7, the issue was gone.

The consequence of this:
1/ dogpile.cache in global-requirements.txt should be promoted to 0.5.7
2/ oslo.cache should depend on this version

This should happen ASAP, to inform downstream distro other than Debian of the issue.

summary: - TestOsloCache: Unit test failure when buildnig debian package for Mitaka
- b3
+ Unit test failure when buildnig debian package for Mitaka b3 if
+ dogpile.cache is not 0.5.7
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in oslo.cache:
status: New → Fix Released
importance: Undecided → High
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :
Changed in nova:
status: New → In Progress
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
Changed in nova:
status: In Progress → 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.