I experienced this failure these days and my unittest always failed at case
"neutron.tests.unit.ml2.drivers.cisco.nexus.test_cisco_mech.TestCiscoBasicGet.test_single_get_admin".
After debugging, I found this bug is caused by ml2 type_drivers entry points not found.
way to reproduce:
1. cd neutron
2. rm -rf neutron.egg-info
3. ./run_tests.sh neutron.tests.unit.ml2.drivers.cisco.nexus.test_cisco_mech.TestCiscoBasicGet.test_single_get_admin
----------------------------------------------------------------------
Ran 2 tests in 25.174s
FAILED (failures=2)
way to fix:
1. python setup.py egg_info
2. ./run_tests.sh neutron.tests.unit.ml2.drivers.cisco.nexus.test_cisco_mech.TestCiscoBasicGet.test_single_get_admin
...
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutron/tests/unit} --list
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutron/tests/unit} --load-list /tmp/tmp1bq15x
neutron.tests.unit.ml2.drivers.cisco.nexus.test_cisco_mech.TestCiscoBasicGet.test_single_get_admin
neutron.tests.unit.ml2.drivers.cisco.nexus.test_cisco_mech.TestCiscoBasicGet.test_single_get_admin ... ok
Slowest Tests
Test id Runtime (s)
-------------------------------------------------------------------------------------------------- -----------
neutron.tests.unit.ml2.drivers.cisco.nexus.test_cisco_mech.TestCiscoBasicGet.test_single_get_admin 1.362
----------------------------------------------------------------------
Ran 1 test in 25.259s
I experienced this failure these days and my unittest always failed at case tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin" .
"neutron.
After debugging, I found this bug is caused by ml2 type_drivers entry points not found.
way to reproduce: tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin
1. cd neutron
2. rm -rf neutron.egg-info
3. ./run_tests.sh neutron.
... OS_STDOUT_ CAPTURE= 1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_ PATH:-. /neutron/ tests/unit} --list OS_STDOUT_ CAPTURE= 1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_ PATH:-. /neutron/ tests/unit} --load-list /tmp/tmp2MIKLY
running=
running=
process-returncode tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin ... FAIL
process-returncode ... FAIL
math domain error
Slowest Tests
neutron.
neutron.
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ------- ------- ------- ------- ------- ------- ------- ------- -------
FAIL: process-returncode
process-returncode
-------
_StringException: Binary content:
traceback (test/plain; charset="utf8")
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin ------- ------- ------- ------- ------- ------- ------- ------- -------
FAIL: neutron.
neutron.
-------
_StringException
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 2 tests in 25.174s
FAILED (failures=2)
way to fix: tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin
1. python setup.py egg_info
2. ./run_tests.sh neutron.
... OS_STDOUT_ CAPTURE= 1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_ PATH:-. /neutron/ tests/unit} --list OS_STDOUT_ CAPTURE= 1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_ PATH:-. /neutron/ tests/unit} --load-list /tmp/tmp1bq15x tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin ... ok ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----------- tests.unit. ml2.drivers. cisco.nexus. test_cisco_ mech.TestCiscoB asicGet. test_single_ get_admin 1.362
running=
running=
neutron.
neutron.
Slowest Tests
Test id Runtime (s)
-------
neutron.
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 1 test in 25.259s
OK
The reason is that when testcase setup Ml2Plugin, Ml2Plugin will initialize TypeManager()(https:/ /github. com/openstack/ neutron/ blob/master/ neutron/ plugins/ ml2/plugin. py#L105). Then TypeManager() will loaded type drivers using stevedore. named.NamedExte nsionManager which invokes entry points(https:/ /github. com/openstack/ neutron/ blob/master/ neutron/ plugins/ ml2/managers. py#L38). But without .egg-info metadata directory, TypeManager cannot find entry points for ml2 type drivers, the testcase failed at setUp(), the unittest process exit without any detailed error information.
This issue shoud affect any testcases which invoke python-stevedore to load plugins.