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

qtbot with PySide2 fails in github actions #293

Closed
jgirardet opened this issue Apr 8, 2020 · 3 comments · Fixed by #295
Closed

qtbot with PySide2 fails in github actions #293

jgirardet opened this issue Apr 8, 2020 · 3 comments · Fixed by #295

Comments

@jgirardet
Copy link
Contributor

hi,
Hi the following bug in github actions CI not locally:

2020-04-08T10:54:24.2278599Z ##[group]Run python -m pytest -vvv -s
2020-04-08T10:54:24.2279416Z �[36;1mpython -m pytest -vvv -s�[0m
2020-04-08T10:54:24.2321201Z shell: /bin/bash -e {0}
2020-04-08T10:54:24.2321307Z env:
2020-04-08T10:54:24.2321402Z   DISPLAY: :99.0
2020-04-08T10:54:24.2321482Z   pythonLocation: /opt/hostedtoolcache/Python/3.7.6/x64
2020-04-08T10:54:24.2321584Z ##[endgroup]
2020-04-08T10:54:24.6769440Z ============================= test session starts ==============================
2020-04-08T10:54:24.6770421Z platform linux -- Python 3.7.6, pytest-5.3.2, py-1.8.1, pluggy-0.13.1 -- /opt/hostedtoolcache/Python/3.7.6/x64/bin/python
2020-04-08T10:54:24.6778989Z cachedir: .pytest_cache
2020-04-08T10:54:24.6779452Z PySide2 5.14.1 -- Qt runtime 5.14.1 -- Qt compiled 5.14.1
2020-04-08T10:54:24.6779578Z rootdir: /home/runner/work/MyCartable/MyCartable
2020-04-08T10:54:24.6779806Z plugins: qt-3.3.0
2020-04-08T10:54:29.2367912Z collecting ... collected 1 item
2020-04-08T10:54:29.2371413Z 
2020-04-08T10:54:29.5635621Z Fatal Python error: Aborted
2020-04-08T10:54:29.5636386Z 
2020-04-08T10:54:29.5636717Z Current thread 0x00007f29af350680 (most recent call first):
2020-04-08T10:54:29.5637935Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pytestqt/plugin.py", line 57 in qapp
2020-04-08T10:54:29.5638869Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 787 in call_fixture_func
2020-04-08T10:54:29.5639674Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 957 in pytest_fixture_setup
2020-04-08T10:54:29.5640725Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
2020-04-08T10:54:29.5641520Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
2020-04-08T10:54:29.5642447Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
2020-04-08T10:54:29.5643218Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
2020-04-08T10:54:29.5644061Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 908 in execute
2020-04-08T10:54:29.5644857Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 579 in _compute_fixture_value
2020-04-08T10:54:29.5646315Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 498 in _get_active_fixturedef
2020-04-08T10:54:29.5647420Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 482 in getfixturevalue
2020-04-08T10:54:29.5648200Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 472 in _fillfixtures
2020-04-08T10:54:29.5648954Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/fixtures.py", line 293 in fillfixtures
2020-04-08T10:54:29.5649714Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/python.py", line 1439 in setup
2020-04-08T10:54:29.5650562Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/runner.py", line 364 in prepare
2020-04-08T10:54:29.5651703Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/runner.py", line 119 in pytest_runtest_setup
2020-04-08T10:54:29.5652460Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
2020-04-08T10:54:29.5653656Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
2020-04-08T10:54:29.5654687Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
2020-04-08T10:54:29.5655769Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
2020-04-08T10:54:29.5658033Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/runner.py", line 207 in <lambda>
2020-04-08T10:54:29.5658900Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/runner.py", line 234 in from_call
2020-04-08T10:54:29.5659717Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/runner.py", line 207 in call_runtest_hook
2020-04-08T10:54:29.5660392Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/runner.py", line 182 in call_and_report
2020-04-08T10:54:29.5661048Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/runner.py", line 90 in runtestprotocol
2020-04-08T10:54:29.5661714Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/runner.py", line 81 in pytest_runtest_protocol
2020-04-08T10:54:29.5662367Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
2020-04-08T10:54:29.5663014Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
2020-04-08T10:54:29.5663710Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
2020-04-08T10:54:29.5664356Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
2020-04-08T10:54:29.5665159Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/main.py", line 270 in pytest_runtestloop
2020-04-08T10:54:29.5665796Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
2020-04-08T10:54:29.5666588Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
2020-04-08T10:54:29.5673468Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
2020-04-08T10:54:29.5674585Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
2020-04-08T10:54:29.5675579Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/main.py", line 246 in _main
2020-04-08T10:54:29.5676250Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/main.py", line 196 in wrap_session
2020-04-08T10:54:29.5676742Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/main.py", line 239 in pytest_cmdline_main
2020-04-08T10:54:29.5677212Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
2020-04-08T10:54:29.5677669Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
2020-04-08T10:54:29.5678125Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
2020-04-08T10:54:29.5678599Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
2020-04-08T10:54:29.5679069Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/_pytest/config/__init__.py", line 92 in main
2020-04-08T10:54:29.5679525Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/site-packages/pytest/__main__.py", line 7 in <module>
2020-04-08T10:54:29.5679746Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/runpy.py", line 85 in _run_code
2020-04-08T10:54:29.5679971Z   File "/opt/hostedtoolcache/Python/3.7.6/x64/lib/python3.7/runpy.py", line 193 in _run_module_as_main
2020-04-08T10:54:39.0807343Z /home/runner/work/_temp/9af4350e-c569-4f21-afd2-8566d9a0c474.sh: line 1:  2584 Aborted                 (core dumped) python -m pytest -vvv -s
2020-04-08T10:54:39.0807950Z tests/test_main.py::test_un 
2020-04-08T10:54:39.0813192Z ##[error]Process completed with exit code 134.
2020-04-08T10:54:39.0827961Z Cleaning up orphan processes
2020-04-08T10:54:39.1122098Z Terminate orphan process: pid (2582) (Xvfb)

the only test is (no import in file):

def test_un(qtbot):
    assert True

conftest file empty.

Not sure if it could be related to #202 or #206

thanks for help

@The-Compiler
Copy link
Member

That stacktrace just means that Qt aborted when creating a QApplication. There's nothing pytest-qt can do about that, it's something which would as well happen if you did run something like:

import sys

from PySide2.QtWidgets import QApplication
app = QApplication(sys.argv)

via Python. Do you have libxkbcommon-x11-0 installed in your environment?

Closing this for now as I don't think there's anything pytest-qt can do here - but feel free to follow up if needed!

@jgirardet
Copy link
Contributor Author

libxkbcommon-x11-0 was the thing. thanks.
maybe could I add it to troubleshooting of doc ?

@nicoddemus
Copy link
Member

@jgirardet good news then.

maybe could I add it to troubleshooting of doc ?

Sure, that would be appreciated, thanks. 👍

jgirardet added a commit to jgirardet/pytest-qt that referenced this issue Apr 9, 2020
I added an example too, since I was looking a working one a few days ago.
Fixes pytest-dev#293
tdowrick added a commit to SciKit-Surgery/scikit-surgeryvtk that referenced this issue May 20, 2020
sjswerdloff added a commit to sjswerdloff/qtpseudo that referenced this issue Oct 6, 2020
install xvfb and libxkbcommon-x11-0 per 
pytest-dev/pytest-qt#293
sjswerdloff added a commit to sjswerdloff/qtpseudo that referenced this issue Oct 6, 2020
* first code commit

* added requirements.txt, tests
modified import statement using try/except
  to not complain in vscode, from command line, or from pytest

* updates based on linter and pytest complaints

* adding setup.py

* importing qtpseudo_controller in __init__.py

* revert pytest to not be python -m pytest

* added __init__.py to tests

* instantiating application and then closing all windows

* remove QApplication() usage from test, it generated a crash

* Update python-app.yml

install xvfb and libxkbcommon-x11-0 per 
pytest-dev/pytest-qt#293

* added use of herbstluftwm per
pytest-dev/pytest-qt#206

* Update python-app.yml

fix herbstluftwm usage in combination with pytest

* Update python-app.yml

trying xvfb-action

* Update python-app.yml

* Update python-app.yml

* Update python-app.yml

using xvfb-run

* Update python-app.yml

* Update python-app.yml

* Update python-app.yml

* Update python-app.yml

trying pytest-xvfb

* Update python-app.yml

installing dependencies

* Update python-app.yml

switched to apt-get vs apt to see if that will silence the warning about unstable api
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

Successfully merging a pull request may close this issue.

3 participants