← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1262089] [NEW] Tracebacks in py26 unit test console logs related to metadata agent

 

Public bug reported:

After adding state reporting to metadata agent following tracebacks
appeared in py26 unit test console logs:

2013-11-22 15:08:33.914 | ERROR:neutron.agent.metadata.agent:Failed reporting state!
2013-11-22 15:08:33.914 | Traceback (most recent call last):
2013-11-22 15:08:33.914 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/agent/metadata/agent.py", line 258, in _report_state
2013-11-22 15:08:33.914 |     use_call=self.agent_state.get('start_flag'))
2013-11-22 15:08:33.914 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/agent/rpc.py", line 74, in report_state
2013-11-22 15:08:33.914 |     return self.cast(context, msg, topic=self.topic)
2013-11-22 15:08:33.915 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/openstack/common/rpc/proxy.py", line 171, in cast
2013-11-22 15:08:33.915 |     rpc.cast(context, self._get_topic(topic), msg)
2013-11-22 15:08:33.915 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/openstack/common/rpc/__init__.py", line 158, in cast
2013-11-22 15:08:33.915 |     return _get_impl().cast(CONF, context, topic, msg)
2013-11-22 15:08:33.915 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/openstack/common/rpc/impl_fake.py", line 166, in cast
2013-11-22 15:08:33.915 |     check_serialize(msg)
2013-11-22 15:08:33.916 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/openstack/common/rpc/impl_fake.py", line 131, in check_serialize
2013-11-22 15:08:33.916 |     json.dumps(msg)
2013-11-22 15:08:33.916 |   File "/usr/lib64/python2.6/json/__init__.py", line 230, in dumps
2013-11-22 15:08:33.916 |     return _default_encoder.encode(obj)
2013-11-22 15:08:33.916 |   File "/usr/lib64/python2.6/json/encoder.py", line 367, in encode
2013-11-22 15:08:33.916 |     chunks = list(self.iterencode(o))
2013-11-22 15:08:33.917 |   File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
2013-11-22 15:08:33.917 |     for chunk in self._iterencode_dict(o, markers):
2013-11-22 15:08:33.917 |   File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
2013-11-22 15:08:33.917 |     for chunk in self._iterencode(value, markers):
2013-11-22 15:08:33.917 |   File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
2013-11-22 15:08:33.917 |     for chunk in self._iterencode_dict(o, markers):
2013-11-22 15:08:33.918 |   File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
2013-11-22 15:08:33.918 |     for chunk in self._iterencode(value, markers):
2013-11-22 15:08:33.918 |   File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
2013-11-22 15:08:33.918 |     for chunk in self._iterencode_dict(o, markers):
2013-11-22 15:08:33.918 |   File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
2013-11-22 15:08:33.918 |     for chunk in self._iterencode(value, markers):
2013-11-22 15:08:33.919 |   File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
2013-11-22 15:08:33.919 |     for chunk in self._iterencode_dict(o, markers):
2013-11-22 15:08:33.919 |   File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
2013-11-22 15:08:33.919 |     for chunk in self._iterencode(value, markers):
2013-11-22 15:08:33.919 |   File "/usr/lib64/python2.6/json/encoder.py", line 317, in _iterencode
2013-11-22 15:08:33.919 |     for chunk in self._iterencode_default(o, markers):
2013-11-22 15:08:33.920 |   File "/usr/lib64/python2.6/json/encoder.py", line 323, in _iterencode_default
2013-11-22 15:08:33.920 |     newobj = self.default(o)
2013-11-22 15:08:33.920 |   File "/usr/lib64/python2.6/json/encoder.py", line 344, in default
2013-11-22 15:08:33.920 |     raise TypeError(repr(o) + " is not JSON serializable")
2013-11-22 15:08:33.920 | TypeError: <MagicMock name='cfg.CONF.host' id='989177040'> is not JSON serializable
2013-11-22 15:08:33.921 | WARNING:neutron.openstack.common.loopingcall:task run outlasted interval by <MagicMock name='cfg.CONF.AGENT.report_interval.__sub__().__neg__()' id='989263056'> sec

this can be observed in jenkins results for any patch on review.

Need to mock loopingcall in metadata agent tests in order to fix this

** Affects: neutron
     Importance: Low
     Assignee: Oleg Bondarev (obondarev)
         Status: New


** Tags: unittest

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1262089

Title:
  Tracebacks in py26 unit test console logs related to metadata agent

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  After adding state reporting to metadata agent following tracebacks
  appeared in py26 unit test console logs:

  2013-11-22 15:08:33.914 | ERROR:neutron.agent.metadata.agent:Failed reporting state!
  2013-11-22 15:08:33.914 | Traceback (most recent call last):
  2013-11-22 15:08:33.914 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/agent/metadata/agent.py", line 258, in _report_state
  2013-11-22 15:08:33.914 |     use_call=self.agent_state.get('start_flag'))
  2013-11-22 15:08:33.914 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/agent/rpc.py", line 74, in report_state
  2013-11-22 15:08:33.914 |     return self.cast(context, msg, topic=self.topic)
  2013-11-22 15:08:33.915 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/openstack/common/rpc/proxy.py", line 171, in cast
  2013-11-22 15:08:33.915 |     rpc.cast(context, self._get_topic(topic), msg)
  2013-11-22 15:08:33.915 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/openstack/common/rpc/__init__.py", line 158, in cast
  2013-11-22 15:08:33.915 |     return _get_impl().cast(CONF, context, topic, msg)
  2013-11-22 15:08:33.915 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/openstack/common/rpc/impl_fake.py", line 166, in cast
  2013-11-22 15:08:33.915 |     check_serialize(msg)
  2013-11-22 15:08:33.916 |   File "/home/jenkins/workspace/gate-neutron-python26/neutron/openstack/common/rpc/impl_fake.py", line 131, in check_serialize
  2013-11-22 15:08:33.916 |     json.dumps(msg)
  2013-11-22 15:08:33.916 |   File "/usr/lib64/python2.6/json/__init__.py", line 230, in dumps
  2013-11-22 15:08:33.916 |     return _default_encoder.encode(obj)
  2013-11-22 15:08:33.916 |   File "/usr/lib64/python2.6/json/encoder.py", line 367, in encode
  2013-11-22 15:08:33.916 |     chunks = list(self.iterencode(o))
  2013-11-22 15:08:33.917 |   File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
  2013-11-22 15:08:33.917 |     for chunk in self._iterencode_dict(o, markers):
  2013-11-22 15:08:33.917 |   File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
  2013-11-22 15:08:33.917 |     for chunk in self._iterencode(value, markers):
  2013-11-22 15:08:33.917 |   File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
  2013-11-22 15:08:33.917 |     for chunk in self._iterencode_dict(o, markers):
  2013-11-22 15:08:33.918 |   File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
  2013-11-22 15:08:33.918 |     for chunk in self._iterencode(value, markers):
  2013-11-22 15:08:33.918 |   File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
  2013-11-22 15:08:33.918 |     for chunk in self._iterencode_dict(o, markers):
  2013-11-22 15:08:33.918 |   File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
  2013-11-22 15:08:33.918 |     for chunk in self._iterencode(value, markers):
  2013-11-22 15:08:33.919 |   File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
  2013-11-22 15:08:33.919 |     for chunk in self._iterencode_dict(o, markers):
  2013-11-22 15:08:33.919 |   File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
  2013-11-22 15:08:33.919 |     for chunk in self._iterencode(value, markers):
  2013-11-22 15:08:33.919 |   File "/usr/lib64/python2.6/json/encoder.py", line 317, in _iterencode
  2013-11-22 15:08:33.919 |     for chunk in self._iterencode_default(o, markers):
  2013-11-22 15:08:33.920 |   File "/usr/lib64/python2.6/json/encoder.py", line 323, in _iterencode_default
  2013-11-22 15:08:33.920 |     newobj = self.default(o)
  2013-11-22 15:08:33.920 |   File "/usr/lib64/python2.6/json/encoder.py", line 344, in default
  2013-11-22 15:08:33.920 |     raise TypeError(repr(o) + " is not JSON serializable")
  2013-11-22 15:08:33.920 | TypeError: <MagicMock name='cfg.CONF.host' id='989177040'> is not JSON serializable
  2013-11-22 15:08:33.921 | WARNING:neutron.openstack.common.loopingcall:task run outlasted interval by <MagicMock name='cfg.CONF.AGENT.report_interval.__sub__().__neg__()' id='989263056'> sec

  this can be observed in jenkins results for any patch on review.

  Need to mock loopingcall in metadata agent tests in order to fix this

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1262089/+subscriptions


Follow ups

References