Comment 0 for bug 1660393

Revision history for this message
Javier Peña (jpena-c) wrote :

When running the unit tests on a single-CPU VM, two of them fail consistently:

======================================================================
FAIL: oslo_messaging.tests.notify.test_notifier.TestRoutingNotifier.test_load_notifiers_config
tags: worker-0
----------------------------------------------------------------------
Empty attachments:
  stderr
  stdout
Traceback (most recent call last):
  File "/builddir/build/BUILD/oslo.messaging-5.17.0/oslo_messaging/tests/notify/test_notifier.py", line 441, in test_load_notifiers_config
    self.router._load_notifiers()
  File "/builddir/build/BUILD/oslo.messaging-5.17.0/oslo_messaging/notify/_impl_routing.py", line 74, in _load_notifiers
    LOG.debug('loading notifiers from %s', self.NOTIFIER_PLUGIN_NAMESPACE)
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 698, in __getattr__
    raise AttributeError("Mock object has no attribute %r" % name)
AttributeError: Mock object has no attribute 'debug'
======================================================================
FAIL: oslo_messaging.tests.notify.test_notifier.TestRoutingNotifier.test_notify_filtered
tags: worker-0
----------------------------------------------------------------------
Empty attachments:
  stderr
  stdout
Traceback (most recent call last):
  File "/builddir/build/BUILD/oslo.messaging-5.17.0/oslo_messaging/tests/notify/test_notifier.py", line 596, in test_notify_filtered
    {}, mock.ANY, 'INFO', None)
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 947, in assert_called_once_with
    raise AssertionError(msg)
AssertionError: Expected 'notify' to be called once. Called 0 times.
Ran 1971 tests in 149.314s
FAILED (id=0, failures=2, skips=53)

Just adding a CPU to the VM makes unit tests pass. Also, fiddling with .testr.conf to increase test concurrency (to e.g. 4) fixes the issue.