Actions
Bug #37370
openTest failures originating in run_tasks/_import are needlessly difficult to debug
% Done:
0%
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):
Description
If someone (like me) writes a task that is buggy and cannot be imported, teuthology will currently fail like this:
2018-11-22T11:00:20.674 INFO:teuthology.run_tasks:Running task foo... 2018-11-22T11:00:20.708 ERROR:teuthology.run_tasks:Saw exception from tasks. Traceback (most recent call last): File "/home/ubuntu/teuthology/teuthology/run_tasks.py", line 95, in run_tasks run_one_task(taskname, stack, timer, ctx=ctx, config=config) File "/home/ubuntu/teuthology/teuthology/run_tasks.py", line 70, in run_one_task task = get_task(taskname) File "/home/ubuntu/teuthology/teuthology/run_tasks.py", line 31, in get_task raise ImportError("Could not find task '{}'".format(name)) ImportError: Could not find task 'foo'
This error message is misleading (or just downright wrong) because the task foo.py does exist in the right place. It just can't be imported due to some problem inside foo.py. But this problem is not reported because teuthology suppresses the "real" ImportError exception and replaces it with its own.
In this case, the "real" ImportError was
ImportError: cannot import name non_existent_function
but that one didn't appear in the log. Instead, we see "ImportError: Could not find task 'foo'", which makes no sense because qa/tasks/foo.py obviously exists.
Updated by Nathan Cutler over 5 years ago
- Description updated (diff)
- Status changed from New to In Progress
Updated by Nathan Cutler over 5 years ago
- Status changed from In Progress to Fix Under Review
Updated by Nathan Cutler over 5 years ago
- Subject changed from Test failures originating in run_tasks/_import are impossible to debug to Test failures originating in run_tasks/_import are needlessly difficult to debug
Actions