summaryrefslogtreecommitdiff
path: root/taskflow/tests/utils.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-07-27 18:04:12 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2015-07-27 18:07:25 -0700
commit6dda5a55c06d71143915635260ff3a31783039ae (patch)
tree7dd8133822142c07a7b5c70d2592f8147190f02f /taskflow/tests/utils.py
parent1847867cc15ff5b65b0dbf4381fe1a8efc3f320d (diff)
downloadtaskflow-6dda5a55c06d71143915635260ff3a31783039ae.tar.gz
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
Diffstat (limited to 'taskflow/tests/utils.py')
-rw-r--r--taskflow/tests/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/taskflow/tests/utils.py b/taskflow/tests/utils.py
index 266a0e8..f465467 100644
--- a/taskflow/tests/utils.py
+++ b/taskflow/tests/utils.py
@@ -123,7 +123,11 @@ class GiveBackRevert(task.Task):
return value + 1
def revert(self, *args, **kwargs):
- return kwargs.get('result') + 1
+ result = kwargs.get('result')
+ # If this somehow fails, timeout, or other don't send back a
+ # valid result...
+ if isinstance(result, six.integer_types):
+ return result + 1
class FakeTask(object):