plugin loading failure just crash without any useful information

Bug #1583220 reported by Mehdi Abaakouk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Confirmed
Medium
Unassigned

Bug Description

Hi, when a tempest plugin fails to load the backtrace doesn't help at all to known which plugins fail.

$ testr list-tests
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --list
No handlers could be found for logger "tempest.test_discover.plugins"
--- import errors ---
Failed to call load_tests:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/unittest2/loader.py", line 136, in loadTestsFromModule
    return load_tests(self, tests, pattern)
  File "tempest/test_discover/test_discover.py", line 27, in load_tests
    ext_plugins = plugins.TempestTestPluginManager()
  File "tempest/lib/common/utils/misc.py", line 30, in getinstance
    instances[cls] = cls()
  File "tempest/test_discover/plugins.py", line 77, in __init__
    on_load_failure_callback=self.failure_hook)
  File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 93, in __init__
    verify_requirements)
  File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 171, in _load_plugins
    self._on_load_failure_callback(self, ep, err)
  File "tempest/test_discover/plugins.py", line 82, in failure_hook
    raise err
ImportError: No module named tests.tempest.plugin
Non-zero exit code (2) from test listing.

Cheers,

Mehdi Abaakouk (sileht)
description: updated
Revision history for this message
Matthew Treinish (treinish) wrote :

So this has come up before and I think we need to improve what we output when we raise here. I'm just not sure exactly how and what is needed here. I agree this isn't super helpful for debugging and requires too much reading into the details to figure it out.

Like, in this case it is saying the plugin is misconfigured and trying to import tests.tempest.plugin (from where ever the plugin is running) Like if it is the cinder plugin its trying to import tests/tempest/plugin.py from the cinder root which doesn't exist. I'm not sure what we need to also output on the error to make this more clear

Changed in tempest:
importance: Undecided → Medium
status: New → Confirmed
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.