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

Hang when trying to run Xvfb #8

Open
The-Compiler opened this issue Oct 7, 2015 · 4 comments
Open

Hang when trying to run Xvfb #8

The-Compiler opened this issue Oct 7, 2015 · 4 comments
Assignees
Labels

Comments

@The-Compiler
Copy link
Member

I tried a minimal testcase using Xvfb:

import faulthandler
import signal
import pytest


faulthandler.register(signal.SIGUSR1)


@pytest.fixture(scope='session')
def run_services():
    return True


def test_foo(xvfb):
    pass

unfortunately that hangs using 100% CPU here:

  File "/home/florian/.venv/lib/python3.4/genericpath.py", line 19 in exists
  File "/home/florian/.venv/local/lib/python3.4/site-packages/pytest_services/locks.py", line 171 in get_display
  File "/home/florian/.venv/local/lib/python3.4/site-packages/pytest_services/locks.py", line 132 in lock_resource
  File "/home/florian/.venv/local/lib/python3.4/site-packages/pytest_services/locks.py", line 176 in get_free_display
  File "/home/florian/.venv/local/lib/python3.4/site-packages/pytest_services/locks.py", line 198 in get_display
  File "/home/florian/.venv/local/lib/python3.4/site-packages/pytest_services/xvfb.py", line 25 in xvfb_display
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 1960 in call_fixture_func
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 2039 in execute
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 1578 in _getfuncargvalue
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 1532 in _get_active_fixturedef
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 2001 in execute
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 1578 in _getfuncargvalue
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 1532 in _get_active_fixturedef
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 1515 in getfuncargvalue
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 1472 in _fillfixtures
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 789 in fillfixtures
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/python.py", line 1324 in setup
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/runner.py", line 403 in prepare
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/runner.py", line 86 in pytest_runtest_setup
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596 in execute
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 264 in __init__
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 247 in _wrapped_call
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 595 in execute
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333 in <lambda>
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338 in _hookexec
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 724 in __call__
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/runner.py", line 137 in <lambda>
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/runner.py", line 149 in __init__
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/runner.py", line 137 in call_runtest_hook
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/runner.py", line 119 in call_and_report
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/runner.py", line 72 in runtestprotocol
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/runner.py", line 65 in pytest_runtest_protocol
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596 in execute
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 264 in __init__
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 247 in _wrapped_call
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 595 in execute
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333 in <lambda>
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338 in _hookexec
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 724 in __call__
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/main.py", line 146 in pytest_runtestloop
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596 in execute
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333 in <lambda>
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338 in _hookexec
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 724 in __call__
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/main.py", line 121 in _main
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/main.py", line 90 in wrap_session
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/main.py", line 115 in pytest_cmdline_main
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596 in execute
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333 in <lambda>
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338 in _hookexec
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 724 in __call__
  File "/home/florian/.venv/local/lib/python3.4/site-packages/_pytest/config.py", line 48 in main
  File "./.venv/bin/py.test", line 11 in <module>

I sampled the stack a few times using faulthandler, and it's either in there or without the first line, in get_display.

This is on Debian Jessie with pytest==2.8.0, pytest-services==1.1.11 and xvfb 2:1.17.2-2, running without xdist. There are no locks in /tmp.

@bubenkoff
Copy link
Member

thanks for the report
will check

@bubenkoff bubenkoff self-assigned this Oct 7, 2015
@The-Compiler
Copy link
Member Author

FWIW using xvfbwrapper from #4 worked fine on the same system, and seems easier for my usecase: qutebrowser/qutebrowser@52ced6c

@bubenkoff
Copy link
Member

well, i can't say i like your solution with configure hooks - simply no reason to use them
generator session scoped fixture would be a solution
may be you can submit a PR implementing #4?

@The-Compiler
Copy link
Member Author

generator session scoped fixture would be a solution

That was my first approach, but it didn't work - the qapp session-scope fixture from pytest-qt was created before the xvfb fixture, and Qt seems to get the DISPLAY when creating the QApplication.

may be you can submit a PR implementing #4?

I'm afraid I'm too busy with other stuff to do that, sorry!

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

No branches or pull requests

2 participants