Tracebacks in py26 unit test console logs related to metadata agent

Bug #1262089 reported by Oleg Bondarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Oleg Bondarev

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

Tags: unittest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/62822

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/62822
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4ded12bef837e707c76af87d71155f04534dcb0d
Submitter: Jenkins
Branch: master

commit 4ded12bef837e707c76af87d71155f04534dcb0d
Author: Oleg Bondarev <email address hidden>
Date: Wed Dec 18 12:14:30 2013 +0400

    Mock looping_call in metadata agent tests

    Change-Id: Icb5146084730384bac1fb7d3176ce0cfcd565cc5
    Closes-Bug: #1262089

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-2 → 2014.1
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.