ProtonVPN / proton-vpn-gtk-app

Official ProtonVPN Linux app
https://protonvpn.com/download-linux
GNU General Public License v3.0
152 stars 20 forks source link

Pytest fails with Segmentation fault on headless session #41

Open alexandrevicenzi opened 3 months ago

alexandrevicenzi commented 3 months ago

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):


The tests fail to run if the session has no desktop environment, for example, over SSH or while building an RPM. On a graphical environment, I see that tests open windows.

Ideally, tests should be skipped if there's no desktop, it might be easier than rewriting tests to not require a desktop env.

tests/unit/widgets/headerbar/menu/settings/test_account_settings.py Fatal Python error: Segmentation fault

Thread 0x00007f0fd4e5b700 (most recent call first):
  File "/usr/lib64/python3.10/selectors.py", line 469 in select
  File "/usr/lib64/python3.10/asyncio/base_events.py", line 1871 in _run_once
  File "/usr/lib64/python3.10/asyncio/base_events.py", line 603 in run_forever
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/proton/vpn/app/gtk/utils/executor.py", line 89 in _run_asyncio_loop_forever
  File "/usr/lib64/python3.10/threading.py", line 953 in run
  File "/usr/lib64/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib64/python3.10/threading.py", line 973 in _bootstrap

Current thread 0x00007f0fe4013740 (most recent call first):
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib64/python3.10/site-packages/gi/overrides/__init__.py", line 313 in new_init
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/proton/vpn/app/gtk/widgets/headerbar/menu/settings/common.py", line 37 in __init__
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/proton/vpn/app/gtk/widgets/headerbar/menu/settings/account_settings.py", line 35 in __init__
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/tests/unit/widgets/headerbar/menu/settings/test_account_settings.py", line 18 in test_account_settings_when_is_called_upon_building_ui_elements
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/python.py", line 195 in pytest_pyfunc_call
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/python.py", line 1772 in runtest
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/runner.py", line 172 in pytest_runtest_call
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/runner.py", line 240 in <lambda>
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/runner.py", line 340 in from_call
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/runner.py", line 239 in call_and_report
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/runner.py", line 134 in runtestprotocol
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/runner.py", line 115 in pytest_runtest_protocol
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/main.py", line 364 in pytest_runtestloop
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/main.py", line 339 in _main
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/main.py", line 285 in wrap_session
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/main.py", line 332 in pytest_cmdline_main
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 174 in main
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 197 in console_main
  File "/home/alexandre/workspace/alxd/proton-vpn-gtk-app/venv/bin/pytest", line 8 in <module>

Extension modules: gi._gi, cairo._cairo, gi._gi_cairo, _cffi_backend, _dbus_bindings, _dbus_glib_bindings (total: 6)
[1]    14235 segmentation fault (core dumped)  pytest
calexandru2018 commented 3 months ago

Hey @alexandrevicenzi thanks for raising this. We actually configure this within our docker images as we basically emulate a desktop. I'll comeback at this tomorrow with the code example of what we're doing.