Test needs to check if int provided as result

Bug #1478744 reported by Joshua Harlow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
taskflow
Fix Released
Medium
Joshua Harlow

Bug Description

Due to CI gate timeouts (slow vms...) the following can happen:

TypeError: unsupported operand type(s) for +: 'Failure' and 'int'

http://logs.openstack.org/41/203441/3/gate/gate-taskflow-python34/91e2d34/console.html

2015-07-27 22:43:14.853 | Traceback (most recent call last):
2015-07-27 22:43:14.853 | File "/home/jenkins/workspace/gate-taskflow-python34/taskflow/tests/utils.py", line 54, in wrap_all_failures
2015-07-27 22:43:14.853 | yield
2015-07-27 22:43:14.853 | File "/home/jenkins/workspace/gate-taskflow-python34/taskflow/test.py", line 196, in assertFailuresRegexp
2015-07-27 22:43:14.853 | callable_obj(*args, **kwargs)
2015-07-27 22:43:14.853 | File "/home/jenkins/workspace/gate-taskflow-python34/taskflow/engines/action_engine/engine.py", line 148, in run
2015-07-27 22:43:14.853 | for _state in self.run_iter():
2015-07-27 22:43:14.854 | File "/home/jenkins/workspace/gate-taskflow-python34/taskflow/engines/action_engine/engine.py", line 199, in run_iter
2015-07-27 22:43:14.854 | self._change_state(states.FAILURE)
2015-07-27 22:43:14.854 | File "/home/jenkins/workspace/gate-taskflow-python34/.tox/py34/lib/python3.4/site-packages/oslo_utils/excutils.py", line 119, in __exit__
2015-07-27 22:43:14.854 | six.reraise(self.type_, self.value, self.tb)
2015-07-27 22:43:14.854 | File "/home/jenkins/workspace/gate-taskflow-python34/.tox/py34/lib/python3.4/site-packages/six.py", line 659, in reraise
2015-07-27 22:43:14.854 | raise value
2015-07-27 22:43:14.854 | File "/home/jenkins/workspace/gate-taskflow-python34/taskflow/engines/action_engine/engine.py", line 183, in run_iter
2015-07-27 22:43:14.854 | failure.Failure.reraise_if_any(failures)
2015-07-27 22:43:14.854 | File "/home/jenkins/workspace/gate-taskflow-python34/taskflow/types/failure.py", line 308, in reraise_if_any
2015-07-27 22:43:14.854 | failures[0].reraise()
2015-07-27 22:43:14.854 | File "/home/jenkins/workspace/gate-taskflow-python34/taskflow/types/failure.py", line 317, in reraise
2015-07-27 22:43:14.855 | raise exc.WrappedFailure([self])
2015-07-27 22:43:14.855 | taskflow.exceptions.WrappedFailure: WrappedFailure: [Failure: TypeError: unsupported operand type(s) for +: 'Failure' and 'int']

So to avoid that we should check if an int was actually returned before further usage (so we don't also mask the initial error).

Joshua Harlow (harlowja)
Changed in taskflow:
importance: Undecided → Medium
assignee: nobody → Joshua Harlow (harlowja)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to taskflow (master)

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

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

Reviewed: https://review.openstack.org/206273
Committed: https://git.openstack.org/cgit/openstack/taskflow/commit/?id=6dda5a55c06d71143915635260ff3a31783039ae
Submitter: Jenkins
Branch: master

commit 6dda5a55c06d71143915635260ff3a31783039ae
Author: Joshua Harlow <email address hidden>
Date: Mon Jul 27 18:04:12 2015 -0700

    Avoid adding 1 to a failure (if it gets triggered)

    Sometimes the CI gate times out and instead of returning
    normal results a failure object is returned, so be more
    careful on adding integers to those objects.

    Closes-Bug: 1478744

    Change-Id: Ibdb9d30266d2a7f3bfeacc39e74cf61b44025a56

Changed in taskflow:
status: In Progress → Fix Committed
Changed in taskflow:
milestone: none → 1.22.0
status: Fix Committed → 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.