Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgr/dashboard: add pytest plugin: faulthandler #25053

Merged
merged 1 commit into from
Nov 16, 2018

Conversation

alfonsomthd
Copy link
Contributor

  • Plugin for pytest that automatically enables the faulthandler module during tests.
  • Very useful when you run tests and face segmentation faults.

Signed-off-by: Alfonso Martínez almartin@redhat.com

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

- Plugin for pytest that automatically enables the faulthandler module during tests.
- Very useful when you run tests and face segmentation faults.

Signed-off-by: Alfonso Martínez <almartin@redhat.com>
@LenzGr
Copy link
Contributor

LenzGr commented Nov 14, 2018

Very useful when you run tests and face segmentation faults

Can you give an example on what kind of "segmentation faults" you're referring to here? A crash of the mgr process?

@alfonsomthd
Copy link
Contributor Author

alfonsomthd commented Nov 14, 2018

Very useful when you run tests and face segmentation faults

Can you give an example on what kind of "segmentation faults" you're referring to here? A crash of the mgr process?

Without plugin:

============================================================================================================================== test session starts ===============================================================================================================================
platform linux2 -- Python 2.7.5, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /ceph/src/pybind/mgr/dashboard, inifile:
plugins: cov-2.5.1
collecting 4 items
ERROR: InvocationError: '/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/bin/py.test --cov=. --cov-report= --junitxml=junit.py27-cov.xml --doctest-modules controllers/rbd.py services/ tests/ tools.py'

With plugin:

============================================================================================================================== test session starts ===============================================================================================================================
platform linux2 -- Python 2.7.5, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /ceph/src/pybind/mgr/dashboard, inifile:
plugins: faulthandler-1.0.1, cov-2.5.1
collecting 4 items

Fatal Python error: Segmentation fault

Current thread 0x00007fd9e0b7e740 <py.test> (most recent call first):
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/dm/xmlsec/binding/init.py", line 19 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/dm/xmlsec/binding/init.py", line 19 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/onelogin/saml2/utils.py", line 33 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/onelogin/saml2/metadata.py", line 17 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/onelogin/saml2/settings.py", line 20 in
File "/ceph/src/pybind/mgr/dashboard/services/sso.py", line 11 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/py/_path/local.py", line 668 in pyimport
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/doctest.py", line 217 in collect
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/runner.py", line 368 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/runner.py", line 189 in init
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/runner.py", line 369 in pytest_make_collect_report
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/callers.py", line 180 in _multicall
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 216 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 222 in _hookexec
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 617 in call
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/runner.py", line 502 in collect_one_node
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/main.py", line 860 in genitems
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/main.py", line 719 in _perform_collect
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/main.py", line 682 in perform_collect
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/main.py", line 152 in pytest_collection
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/callers.py", line 180 in _multicall
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 216 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 222 in _hookexec
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 617 in call
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/main.py", line 142 in _main
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/main.py", line 105 in wrap_session
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/main.py", line 136 in pytest_cmdline_main
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/callers.py", line 180 in _multicall
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 216 in
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 222 in _hookexec
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/pluggy/init.py", line 617 in call
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/lib/python2.7/site-packages/_pytest/config.py", line 59 in main
File "/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/bin/py.test", line 11 in
ERROR: InvocationError: '/ceph/src/pybind/mgr/dashboard/.tox/py27-cov/bin/py.test --cov=. --cov-report= --junitxml=junit.py27-cov.xml --doctest-modules controllers/rbd.py services/ tests/ tools.py'

Copy link
Contributor

@LenzGr LenzGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info. Makes sense to me!

@LenzGr LenzGr merged commit d7ae646 into ceph:master Nov 16, 2018
@tchaikov
Copy link
Contributor

it's SAML-Toolkits/python-saml#30

Core was generated by `/home/kchai/ceph/build/py27-cov/bin/python2.7 /home/kchai/ceph/build/py27-cov/b'.
Program terminated with signal 11, Segmentation fault.
#0  __pyx_f_4lxml_5etree_funicode (__pyx_v_s=__pyx_v_s@entry=0x10 <Address 0x10 out of bounds>) at src/lxml/etree.c:34651
34651	src/lxml/etree.c: No such file or directory.
Missing separate debuginfos, use: debuginfo-install expat-2.1.0-10.el7_3.aarch64 glibc-2.17-196.el7_4.2.aarch64 keyutils-libs-1.5.8-3.el7.aarch64 krb5-libs-1.15.1-8.el7.aarch64 libcom_err-1.42.9-10.el7.aarch64 libffi-3.0.13-18.el7.aarch64 libgcrypt-1.5.3-14.el7.aarch64 libgpg-error-1.12-3.el7.aarch64 libselinux-2.5-11.el7.aarch64 libtool-ltdl-2.4.2-22.el7_3.aarch64 libuuid-2.23.2-43.el7_4.2.aarch64 libxml2-2.9.1-6.el7_2.3.aarch64 libxslt-1.1.28-5.el7.aarch64 openssl-libs-1.0.2k-8.el7.aarch64 pcre-8.32-17.el7.aarch64 python-libs-2.7.5-58.el7.aarch64 xmlsec1-1.2.20-7.el7_4.aarch64 xmlsec1-openssl-1.2.20-7.el7_4.aarch64 xz-libs-5.2.2-1.el7.aarch64 zlib-1.2.7-17.el7.aarch64
(gdb) bt
#0  __pyx_f_4lxml_5etree_funicode (__pyx_v_s=__pyx_v_s@entry=0x10 <Address 0x10 out of bounds>) at src/lxml/etree.c:34651
#1  0x0000ffff92079ae4 in pyunicode (__pyx_v_s=0x10 <Address 0x10 out of bounds>) at src/lxml/etree.c:223307
#2  0x0000ffff91c6d08c in __pyx_f_2dm_6xmlsec_7binding_7_xmlsec_xmlChar2py (__pyx_v_xs=<optimized out>) at src/_xmlsec.c:11466
#3  0x0000ffff91c6d508 in __pyx_pf_2dm_6xmlsec_7binding_7_xmlsec_9Transform_4href___get__ (__pyx_v_self=<optimized out>) at src/_xmlsec.c:3328
#4  __pyx_pw_2dm_6xmlsec_7binding_7_xmlsec_9Transform_4href_1__get__ (__pyx_v_self=<optimized out>) at src/_xmlsec.c:3315
#5  __pyx_getprop_2dm_6xmlsec_7binding_7_xmlsec_9Transform_href (o=<optimized out>, x=<optimized out>) at src/_xmlsec.c:11899
#6  0x0000ffff9a651028 in getset_get () from /lib64/libpython2.7.so.1.0
#7  0x0000ffff91c6a86c in __Pyx_PyObject_GenericGetAttrNoDict (attr_name=0x39a7fd20, obj=0x3957f8b8) at src/_xmlsec.c:16109
#8  __Pyx_PyObject_GenericGetAttr (obj=0x3957f8b8, attr_name=0x39a7fd20) at src/_xmlsec.c:16124
#9  0x0000ffff9a677910 in PyObject_GetAttr () from /lib64/libpython2.7.so.1.0
#10 0x0000ffff9a6d1b10 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#11 0x0000ffff9a6564a8 in gen_send_ex.isra.0 () from /lib64/libpython2.7.so.1.0
#12 0x0000ffff9a63d0a0 in PyIter_Next () from /lib64/libpython2.7.so.1.0
#13 0x0000ffff9a673aa8 in PyDict_MergeFromSeq2 () from /lib64/libpython2.7.so.1.0
#14 0x0000ffff9a6740c0 in dict_update_common () from /lib64/libpython2.7.so.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants