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

Pytest stall #8927

Closed
douglas-raillard-arm opened this issue Jul 21, 2021 · 2 comments
Closed

Pytest stall #8927

douglas-raillard-arm opened this issue Jul 21, 2021 · 2 comments

Comments

@douglas-raillard-arm
Copy link

a detailed description of the bug or problem you are having

Pytest stalls in some specific conditions:

  • running on GitHub action runner or Virtualbox (via vagrant)
  • When not setting --log-cli-level
  • On some test that uses subprocess to spawn some executable
    When connecting to the pytest process with gdb, I get this backtrace:
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fc33a40a5f0) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7fc33a40a638, cond=0x7fc33a40a5c8) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7fc33a40a5c8, mutex=0x7fc33a40a638) at pthread_cond_wait.c:638
#3  0x00007fc33b69c9a5 in background_thread_sleep (tsdn=<optimized out>, interval=<optimized out>, info=<optimized out>) at src/background_thread.c:232
#4  background_work_sleep_once (ind=0, info=<optimized out>, tsdn=<optimized out>) at src/background_thread.c:307
#5  background_thread0_work (tsd=<optimized out>) at src/background_thread.c:452
#6  background_work (ind=<optimized out>, tsd=<optimized out>) at src/background_thread.c:490
#7  background_thread_entry (ind_arg=<optimized out>) at src/background_thread.c:522
#8  0x00007fc34dfc0609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00007fc34e0fc293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

output of pip list from the virtual environment you are using

Package                       Version    Location
----------------------------- ---------- -----------------------
alabaster                     0.7.12
anyio                         3.2.1
argon2-cffi                   20.1.0
async-generator               1.10
attrs                         21.2.0
Babel                         2.9.1
backcall                      0.2.0
bcrypt                        3.2.0
bisector                      1.0        /vagrant/tools/bisector
bleach                        3.3.1
bokeh                         2.3.3
build                         0.5.1
certifi                       2021.5.30
cffi                          1.14.6
charset-normalizer            2.0.3
click                         8.0.1
cloudpickle                   1.6.0
colorama                      0.4.4
colorcet                      2.0.6
cryptography                  3.4.7
cycler                        0.10.0
dask                          2021.7.0
datashader                    0.13.0
datashape                     0.5.2
debugpy                       1.3.0
decorator                     5.0.9
defusedxml                    0.7.1
devlib                        1.3.2.dev1
distributed                   2021.7.0
docutils                      0.16
entrypoints                   0.3
exekall                       1.0        /vagrant/tools/exekall
fsspec                        2021.7.0
future                        0.18.2
fuzzywuzzy                    0.18.0
HeapDict                      1.0.1
holoviews                     1.14.5
idna                          3.2
imagesize                     1.2.0
importlib-metadata            4.6.1
iniconfig                     1.1.1
ipykernel                     6.0.3
ipython                       7.25.0
ipython-genutils              0.2.0
ipywidgets                    7.6.3
jedi                          0.18.0
jeepney                       0.7.0
Jinja2                        3.0.1
json5                         0.9.6
jsonschema                    3.2.0
jupyter-client                6.1.12
jupyter-core                  4.7.1
jupyter-server                1.9.0
jupyterlab                    3.0.16
jupyterlab-pygments           0.1.2
jupyterlab-server             2.6.1
jupyterlab-widgets            1.0.0
keyring                       23.0.1
kiwisolver                    1.3.1
LISA                          2.0
lisa-linux                    2.0.0      /vagrant
llvmlite                      0.36.0
locket                        0.2.1
Louie-latest                  1.3.1
lxml                          4.6.3
Markdown                      3.3.4
MarkupSafe                    2.0.1
matplotlib                    3.4.2
matplotlib-inline             0.1.2
mistune                       0.8.4
msgpack                       1.0.2
multipledispatch              0.6.0
nbclassic                     0.3.1
nbclient                      0.5.3
nbconvert                     6.1.0
nbformat                      5.1.3
nbsphinx                      0.8.6
nest-asyncio                  1.5.1
nose                          1.3.7
notebook                      6.4.0
numba                         0.53.1
numpy                         1.21.1
packaging                     21.0
pandas                        1.3.0
pandocfilters                 1.4.3
panel                         0.12.0
param                         1.11.1
paramiko                      2.7.2
parso                         0.8.2
partd                         1.2.0
pep517                        0.11.0
pexpect                       4.8.0
phantomjs                     1.4.1
pickleshare                   0.7.5
Pillow                        8.3.1
pip                           21.1.3
pip-autoremove                0.9.1
pkg-resources                 0.0.0
pkginfo                       1.7.1
pluggy                        0.13.1
prometheus-client             0.11.0
prompt-toolkit                3.0.19
psutil                        5.8.0
ptyprocess                    0.7.0
py                            1.10.0
pyarrow                       4.0.1
pycparser                     2.20
pyct                          0.4.8
Pygments                      2.9.0
PyNaCl                        1.4.0
pyparsing                     2.4.7
pyrsistent                    0.18.0
pyserial                      3.5
pytest                        6.2.4
python-dateutil               2.8.2
pytz                          2021.1
pyviz-comms                   2.1.0
PyYAML                        5.4.1
pyzmq                         22.1.0
readme-renderer               29.0
requests                      2.26.0
requests-toolbelt             0.9.1
requests-unixsocket           0.2.0
rfc3986                       1.5.0
ruamel.yaml                   0.17.10
ruamel.yaml.clib              0.2.6
scipy                         1.7.0
scp                           0.13.6
SecretStorage                 3.3.1
selenium                      3.141.0
Send2Trash                    1.7.1
setuptools                    57.4.0
six                           1.16.0
sniffio                       1.2.0
snowballstemmer               2.1.0
sortedcontainers              2.4.0
Sphinx                        4.1.1
sphinx-rtd-theme              0.5.2
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-plantuml        0.21
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
sphobjinv                     2.1
tblib                         1.7.0
terminado                     0.10.1
testpath                      0.5.0
toml                          0.10.2
tomli                         1.0.4
toolz                         0.11.1
tornado                       6.1
tqdm                          4.61.2
traitlets                     5.0.5
twine                         3.4.2
typing-extensions             3.10.0.0
urllib3                       1.26.6
wcwidth                       0.2.5
webencodings                  0.5.1
websocket-client              1.1.0
wheel                         0.36.2
widgetsnbextension            3.5.1
wlauto                        3.3.1.dev1
wrapt                         1.12.1
xarray                        0.18.2
zict                          2.0.0
zipp                          3.5.0

pytest and operating system versions

pytest==6.2.4

Host: Archlinux, Linux 5.12.15-arch1-1 #1 SMP PREEMPT Wed, 07 Jul 2021 23:35:29 +0000
Guest: Ubuntu 20.04.2 LTS (Focal Fossa), Linux 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021

minimal example if possible

Maybe this is related to that issue (at least the leaf C function matches):
https://forge.softwareheritage.org/D5048

I'll post the setup I'm currently using once I merged the (unrelated) fixes to my Vagrantfile. It's not so minimal but at least it can reproduce the issue (on my machine).

@douglas-raillard-arm
Copy link
Author

It looks like passing -s "solves" the problem

@douglas-raillard-arm
Copy link
Author

Closing as the issue seems to be coming from a threading.Lock in a library, that should be an RLock. I'm still unsure why it only triggers when capturing the output though ...

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

No branches or pull requests

1 participant