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

Investigate test flakiness #32

Closed
Tbruno25 opened this issue Jul 10, 2024 · 1 comment · Fixed by #34
Closed

Investigate test flakiness #32

Tbruno25 opened this issue Jul 10, 2024 · 1 comment · Fixed by #34

Comments

@Tbruno25
Copy link
Owner

The test suite will fail if modules are collected and run in alphabetical order (default)

Notes:

  • all modules are successful if run individually
  • test suite successful if test_gui.py is run before all others

log:

✦5 ❯ poetry run pytest -v
=============================================================================================== test session starts ================================================================================================
platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.5.0 -- /home/tj/projects/can-explorer/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/tj/projects/can-explorer
plugins: order-1.2.1
collected 7 items                                                                                                                                                                                                  

tests/test_app.py::test_app_must_apply_settings_before_running PASSED                                                                                                                                        [ 14%]
tests/test_app.py::test_app_must_be_inactive_to_apply_settings PASSED                                                                                                                                        [ 28%]
tests/test_controller.py::test_controller_starts_worker PASSED                                                                                                                                               [ 42%]
tests/test_controller.py::test_controller_stops_worker PASSED                                                                                                                                                [ 57%]
tests/test_controller.py::test_controller_populates_data_in_ascending_order PASSED                                                                                                                           [ 71%]
tests/test_gui.py::test_gui_launch_basic Fatal Python error: Segmentation fault

Current thread 0x00007f0881ffb640 (most recent call first):
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/dearpygui/dearpygui.py", line 9008 in set_axis_limits
  File "/home/tj/projects/can-explorer/src/can_explorer/plotting.py", line 56 in update
  File "/home/tj/projects/can-explorer/src/can_explorer/views.py", line 60 in update
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/wrapt/decorators.py", line 527 in _synchronized_wrapper
  File "/home/tj/projects/can-explorer/src/can_explorer/controllers.py", line 116 in _worker_loop
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f08827fc640 (most recent call first):
  File "/usr/lib/python3.10/threading.py", line 324 in wait
  File "/usr/lib/python3.10/queue.py", line 180 in get
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/can/interfaces/virtual.py", line 131 in _recv_internal
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/can/bus.py", line 127 in recv
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/can/notifier.py", line 126 in _rx_thread
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f0882ffd640 (most recent call first):
  File "/usr/lib/python3.10/threading.py", line 324 in wait
  File "/usr/lib/python3.10/threading.py", line 607 in wait
  File "/home/tj/projects/can-explorer/src/can_explorer/controllers.py", line 105 in _worker_loop
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f08837fe640 (most recent call first):
  File "/usr/lib/python3.10/threading.py", line 324 in wait
  File "/usr/lib/python3.10/threading.py", line 607 in wait
  File "/home/tj/projects/can-explorer/src/can_explorer/controllers.py", line 105 in _worker_loop
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f0883fff640 (most recent call first):
  File "/usr/lib/python3.10/threading.py", line 324 in wait
  File "/usr/lib/python3.10/queue.py", line 180 in get
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/can/interfaces/virtual.py", line 131 in _recv_internal
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/can/bus.py", line 127 in recv
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/can/notifier.py", line 126 in _rx_thread
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f08acc31000 (most recent call first):
  File "/usr/lib/python3.10/selectors.py", line 416 in select
  File "/usr/lib/python3.10/subprocess.py", line 2021 in _communicate
  File "/usr/lib/python3.10/subprocess.py", line 1154 in communicate
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pyvirtualdisplay/util.py", line 19 in get_helptext
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pyvirtualdisplay/abstractdisplay.py", line 85 in __init__
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pyvirtualdisplay/xephyr.py", line 36 in __init__
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pyvirtualdisplay/display.py", line 54 in __init__
  File "/home/tj/projects/can-explorer/tests/test_gui.py", line 47 in virtual_display
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 895 in call_fixture_func
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 1123 in pytest_fixture_setup
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 1069 in execute
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 693 in _compute_fixture_value
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 607 in _get_active_fixturedef
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 1045 in execute
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 693 in _compute_fixture_value
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 607 in _get_active_fixturedef
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 1045 in execute
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 693 in _compute_fixture_value
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 607 in _get_active_fixturedef
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 585 in getfixturevalue
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/fixtures.py", line 566 in _fillfixtures
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/python.py", line 1795 in setup
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 494 in setup
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 157 in pytest_runtest_setup
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 262 in <lambda>
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 341 in from_call
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 261 in call_runtest_hook
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 222 in call_and_report
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 127 in runtestprotocol
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/runner.py", line 114 in pytest_runtest_protocol
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/main.py", line 350 in pytest_runtestloop
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/main.py", line 325 in _main
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/main.py", line 271 in wrap_session
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/main.py", line 318 in pytest_cmdline_main
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 169 in main
  File "/home/tj/projects/can-explorer/.venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 192 in console_main
  File "/home/tj/projects/can-explorer/.venv/bin/pytest", line 8 in <module>

Extension modules: dearpygui._dearpygui, numpy._core._multiarray_umath, numpy._core._multiarray_tests, numpy.linalg._umath_linalg, PIL._imaging (total: 5)
Segmentation fault (core dumped)
@Tbruno25
Copy link
Owner Author

Bug was due to the controller not being properly shutdown during testing.

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.

1 participant