taskflow py35 unit test failed

Bug #1687855 reported by ChangBo Guo(gcb)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
taskflow
Fix Released
Undecided
ChangBo Guo(gcb)

Bug Description

taskflow unit tests failed on Python 3 recently. the root cause is that dict.keys() returns instance

dict_keys, which does work well with kombu when encoding it to json. raise error as below:

ft1.36: taskflow.tests.test_examples.ExamplesTestCase.test_wbe_event_sender_StringException: Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/home/jenkins/workspace/gate-taskflow-python35/taskflow/tests/test_examples.py", line 111, in test_example
    self._check_example(example_name)
  File "/home/jenkins/workspace/gate-taskflow-python35/taskflow/tests/test_examples.py", line 126, in _check_example
    output = run_example(name)
  File "/home/jenkins/workspace/gate-taskflow-python35/taskflow/tests/test_examples.py", line 81, in run_example
    % (name, rc, stdout, stderr))
RuntimeError: Example wbe_event_sender failed, return code=1
<<<Begin captured STDOUT>>>
Running 1 workers.
Executing some work.
Recieved event 'update_progress'
Details = {'progress': 0.0}
Recieved event 'update_progress'
Details = {'progress': 0.0}
Stopping workers.
<<<End captured STDOUT>>>
<<<Begin captured STDERR>>>
CRITICAL:taskflow.engines.worker_based.server:Failed to send reply to '192635d8-eac8-46ef-b575-bd85f1d8f7b3' with notify response '<Notify object at 0x7fefb9f606d8 with contents {'topic': 'worker-1', 'tasks': dict_keys(['__main__.EventReporter'])}>'
Traceback (most recent call last):
  File "/home/jenkins/workspace/gate-taskflow-python35/.tox/py35/lib/python3.5/site-packages/kombu/serialization.py", line 50, in _reraise_errors
    yield
  File "/home/jenkins/workspace/gate-taskflow-python35/.tox/py35/lib/python3.5/site-packages/kombu/serialization.py", line 221, in dumps
    payload = encoder(data)
  File "/home/jenkins/workspace/gate-taskflow-python35/.tox/py35/lib/python3.5/site-packages/kombu/utils/json.py", line 72, in dumps
    **dict(default_kwargs, **kwargs))
  File "/usr/lib/python3.5/json/__init__.py", line 237, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.5/json/encoder.py", line 198, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.5/json/encoder.py", line 256, in iterencode
    return _iterencode(o, 0)
  File "/home/jenkins/workspace/gate-taskflow-python35/.tox/py35/lib/python3.5/site-packages/kombu/utils/json.py", line 62, in default
    return super(JSONEncoder, self).default(o)
  File "/usr/lib/python3.5/json/encoder.py", line 179, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: dict_keys(['__main__.EventReporter']) is not JSON serializable

For more error logs, please see
http://logs.openstack.org/66/460966/1/check/gate-taskflow-python35/f6ea5e1/testr_results.html.gz

Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :
Changed in taskflow:
assignee: nobody → ChangBo Guo(gcb) (glongwave)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to taskflow (master)

Reviewed: https://review.openstack.org/461987
Committed: https://git.openstack.org/cgit/openstack/taskflow/commit/?id=365dff9e2b88a07188f94d74ed6b78487426f7bb
Submitter: Jenkins
Branch: master

commit 365dff9e2b88a07188f94d74ed6b78487426f7bb
Author: ChangBo Guo(gcb) <email address hidden>
Date: Wed May 3 12:39:33 2017 +0800

    Fix py35 test failure

    dict.keys() returns object dict_keys on Python 3, can't work well
    with kombu recently, convert it to list before futhur processing.

    Closes-Bug: #1687855
    Change-Id: I9dcfadd8f16eccce06f4cde3b2a6669f28a3f8bc

Changed in taskflow:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/taskflow 2.11.0

This issue was fixed in the openstack/taskflow 2.11.0 release.

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.