spyder: Failing tests with Spyder 5.3.x and Debian unstable

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Thanks all for your great work on getting 5.3.0 released! I’m pleased to say that all of the tests that were failing with 5.2.x now work. There are just a new problematic tests, and I don’t know enough to understand what is wrong. But besides these, it looks very good, so I’ll upload 5.3.0 to Debian unstable (with these tests disabled) and then submit a further issue if any of them fail on architectures other than amd64.

test_mainwindow.py segfaults

spyder/app/tests/test_mainwindow.py regularly segfaults. Here’s an example of running this test alone. (My runtests.py is a slightly modified version of the official version, introducing the --homedir option.) I don’t know whether there’s enough information here to help identify the source of the crash, though.

euler:~/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1 $ CI=true HOME=/tmp/homedir xvfb-run -a -s "-screen 0 1024x768x24 +extension GLX" python3.9 runtests.py --homedir=/tmp/homedir --run-slow -v 'spyder/app/tests/test_mainwindow.py'
Pytest Arguments: ['-vv', '-rw', '--durations=10', '-W ignore::UserWarning', '--run-slow', '-v', 'spyder/app/tests/test_mainwindow.py']
============================= test session starts ==============================
platform linux -- Python 3.9.12, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /usr/bin/python3.9
cachedir: .pytest_cache
PySide2 5.15.2 -- Qt runtime 5.15.2 -- Qt compiled 5.15.2
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/.hypothesis/examples')
rootdir: /home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1, configfile: pytest.ini
plugins: lazy-fixture-0.6.3, xdist-2.5.0, anyio-3.5.0, order-1.0.1, mock-3.6.1, forked-1.4.0, cov-3.0.0, timeout-2.1.0, qt-4.0.2, dependency-0.5.1, flaky-3.7.0, hypothesis-6.36.0
collected 108 items                                                            

spyder/app/tests/test_mainwindow.py::test_single_instance_and_edit_magic Fatal Python error: Segmentation fault

Thread 0x00007f623f7fe640 (most recent call first):
  File "/usr/lib/python3.9/threading.py", line 312 in wait
  File "/usr/lib/python3.9/threading.py", line 574 in wait
  File "/usr/lib/python3/dist-packages/IPython/core/history.py", line 829 in run
  File "/usr/lib/python3/dist-packages/IPython/core/history.py", line 60 in only_when_enabled
  File "<decorator-gen-17>", line 2 in run
  File "/usr/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 930 in _bootstrap

Thread 0x00007f626d7fa640 (most recent call first):
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/onlinehelp/pydoc_patch.py", line 938 in serve_until_quit
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/onlinehelp/pydoc_patch.py", line 967 in run
  File "/usr/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/usr/lib/python3.9/threading.py", line 930 in _bootstrap

Current thread 0x00007f6472393740 (most recent call first):
  File "/usr/lib/python3/dist-packages/qtconsole/console_widget.py", line 342 in __init__
  File "/usr/lib/python3/dist-packages/qtconsole/history_console_widget.py", line 27 in __init__
  File "/usr/lib/python3/dist-packages/qtconsole/frontend_widget.py", line 165 in __init__
  File "/usr/lib/python3/dist-packages/qtconsole/jupyter_widget.py", line 118 in __init__
  File "/usr/lib/python3/dist-packages/qtconsole/rich_jupyter_widget.py", line 55 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/debugging.py", line 75 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/debugging.py", line 195 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/shell.py", line 119 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/client.py", line 146 in __init__
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/main_widget.py", line 1548 in create_new_client
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/plugin.py", line 521 in create_new_client
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/plugin.py", line 389 in on_mainwindow_visible
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/mainwindow.py", line 1169 in post_visible_setup
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/utils.py", line 300 in create_window
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/mainwindow.py", line 1989 in main
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/start.py", line 234 in main
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/tests/test_mainwindow.py", line 331 in main_window
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 925 in call_fixture_func
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 1126 in pytest_fixture_setup
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 1072 in execute
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 687 in _compute_fixture_value
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 601 in _get_active_fixturedef
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 581 in getfixturevalue
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 568 in _fillfixtures
  File "/usr/lib/python3/dist-packages/pytest_lazyfixture.py", line 39 in fill
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1647 in setup
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 449 in prepare
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 150 in pytest_runtest_setup
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 255 in <lambda>
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 311 in from_call
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 254 in call_runtest_hook
  File "/usr/lib/python3/dist-packages/flaky/flaky_pytest_plugin.py", line 138 in call_and_report
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 120 in runtestprotocol
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 109 in pytest_runtest_protocol
  File "/usr/lib/python3/dist-packages/flaky/flaky_pytest_plugin.py", line 94 in pytest_runtest_protocol
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 348 in pytest_runtestloop
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 323 in _main
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 269 in wrap_session
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 316 in pytest_cmdline_main
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
  File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 162 in main
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 48 in run_pytest
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 78 in main
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 82 in <module>
Segmentation fault

test_get_hints fails

spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_hints fails with all three parameters, both with Python 3.9 and Python 3.10; here’s one of the test logs:

___________________________ test_get_hints[params0] ____________________________

qtbot = <pytestqt.qtbot.QtBot object at 0x7f10c7c49a00>
completions_codeeditor = (<spyder.plugins.editor.widgets.codeeditor.CodeEditor object at 0x7f10a29a89d0>, <spyder.plugins.completion.plugin.CompletionPlugin object at 0x7f10a2cc5820>)
params = ('"".format', '-> str')
capsys = <_pytest.capture.CaptureFixture object at 0x7f10a2ef6fd0>

    @pytest.mark.slow
    @pytest.mark.order(2)
    @pytest.mark.skipif(sys.platform == 'darwin', reason='Fails on Mac')
    @pytest.mark.parametrize('params', [
            # Parameter, Expected Output
            ('"".format', '-> str'),
            ('import math', 'module'),
            (TEST_TEXT, TEST_DOCSTRING)
        ]
    )
    def test_get_hints(qtbot, completions_codeeditor, params, capsys):
        """Test that the editor is returning hover hints."""
        code_editor, _ = completions_codeeditor
        param, expected_output_text = params
    
        # Move mouse to another position to be sure the hover is displayed when
        # the cursor is put on top of the tested word.
        qtbot.mouseMove(code_editor, QPoint(400, 400))
    
        # Set text in editor
        code_editor.set_text(param)
    
        # Get cursor coordinates
        code_editor.moveCursor(QTextCursor.End)
        qtbot.keyPress(code_editor, Qt.Key_Left)
    
        # Wait a bit in case the window manager repositions the window.
        qtbot.wait(1000)
    
        # Position cursor on top of word we want the hover for.
        x, y = code_editor.get_coordinates('cursor')
        point = code_editor.calculate_real_position(QPoint(x, y))
    
        # Get hover and compare
        with qtbot.waitSignal(code_editor.sig_display_object_info,
                              timeout=30000) as blocker:
            qtbot.mouseMove(code_editor, point)
            qtbot.mouseClick(code_editor, Qt.LeftButton, pos=point)
>           qtbot.waitUntil(lambda: code_editor.tooltip_widget.isVisible(),
                            timeout=10000)
E           pytestqt.exceptions.TimeoutError: waitUntil timed out in 10000 milliseconds

spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py:171: TimeoutError

I do seem to get the expected behaviour when I perform these actions manually.

Versions

  • Spyder version: 5.3.0
  • Python version: 3.9.12 and 3.10.4
  • Qt version: 5.15.2
  • PyQt version: 5.15.6
  • Operating System name/version: Linux 5.16.0-5-amd64 (Debian unstable)

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.31.1              :  8.0.1 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.0 (OK)
jellyfish >=0.7               :  0.8.9 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.5.0 (OK)
nbconvert >=4.0               :  6.4.4 (OK)
numpydoc >=0.6.0              :  1.2.1 (OK)
parso >=0.7.0;<0.9.0          :  0.8.1 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0                :  2.12.2 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.4.1;<1.5.0          :  1.4.1 (OK)
pylsp_black >=1.2.0           :  1.2.0 (OK)
qdarkstyle >=3.0.2;<3.1.0     :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.1.1 (OK)
qtconsole >=5.3.0;<5.4.0      :  5.3.0 (OK)
qtpy >=2.0.1                  :  2.0.1 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  59.6.0 (OK)
sphinx >=0.6.6                :  4.3.2 (OK)
spyder_kernels >=2.3.0;<2.4.0 :  2.3.0 (OK)
textdistance >=4.2.0          :  4.2.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.7 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  0.29.28 (OK)
matplotlib >=3.0.0            :  3.5.1 (OK)
numpy >=1.7                   :  1.21.5 (OK)
pandas >=1.1.1                :  1.3.5 (OK)
scipy >=0.17.0                :  1.7.3 (OK)
sympy >=0.7.3                 :  1.9 (OK)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

Hi there! Here’s an update with Spyder 5.3.1 on amd64.

Things are generally better than with 5.3.0! Only two tests are still consistently failing; the first is spyder/app/tests/test_mainwindow.py::test_run_cython_code

Here is an example of it (and we still don’t have debugpy, but that seems to be unrelated):

_____________________________ test_run_cython_code _____________________________

main_window = <spyder.app.mainwindow.MainWindow object at 0x7fd754ada700>
qtbot = <pytestqt.qtbot.QtBot object at 0x7fd754d37fd0>

    @pytest.mark.slow
    @flaky(max_runs=3)
    @pytest.mark.skipif(
        (os.name == 'nt' or sys.platform == 'darwin' or
         parse_version(ipy_release.version) == parse_version('7.11.0')),
        reason="Hard to test on Windows and macOS and fails for IPython 7.11.0")
    def test_run_cython_code(main_window, qtbot):
        """Test all the different ways we have to run Cython code"""
        # ---- Setup ----
        # Get a reference to the code editor widget
        code_editor = main_window.editor.get_focus_widget()
    
        # ---- Run pyx file ----
        # Load test file
        main_window.editor.load(osp.join(LOCATION, 'pyx_script.pyx'))
    
        # Run file
        qtbot.keyClick(code_editor, Qt.Key_F5)
    
        # Get a reference to the namespace browser widget
        nsb = main_window.variableexplorer.current_widget()
    
        # Wait until an object appears
>       qtbot.waitUntil(lambda: nsb.editor.source_model.rowCount() == 1,
                        timeout=COMPILE_AND_EVAL_TIMEOUT)
E       pytestqt.exceptions.TimeoutError: waitUntil timed out in 30000 milliseconds

/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/test_mainwindow.py:1349: TimeoutError
----------------------------- Captured Qt messages -----------------------------
QtWarningMsg: Attribute Qt::AA_UseSoftwareOpenGL must be set before QCoreApplication is created.
QtWarningMsg: Scenegraph already initialized, setBackend() request ignored
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.4qx5x6ye/downtmp/build.Ycv/src/spyder/app/tests')

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [2]: 

And the second test almost always fails: spyder/app/tests/test_mainwindow.py::test_ordering_lsp_requests_at_startup

Here is some sample output:

____________________ test_ordering_lsp_requests_at_startup _____________________

main_window = <spyder.app.mainwindow.MainWindow object at 0x7ff9d82ec280>
qtbot = <pytestqt.qtbot.QtBot object at 0x7ff948040250>

    @pytest.mark.slow
    @flaky(max_runs=3)
    @pytest.mark.use_introspection
    @pytest.mark.order(after="test_debug_unsaved_function")
    @pytest.mark.preload_project
    @pytest.mark.skipif(os.name == 'nt', reason='Times out on Windows')
    def test_ordering_lsp_requests_at_startup(main_window, qtbot):
        """
        Test the ordering of requests we send to the LSP at startup when a
        project was left open during the previous session.
    
        This is a regression test for spyder-ide/spyder#13351.
        """
        # Wait until the LSP server is up.
        code_editor = main_window.editor.get_current_editor()
        qtbot.waitSignal(code_editor.completions_response_signal, timeout=30000)
    
        # Wait until the initial requests are sent to the server.
        lsp = main_window.completions.get_provider('lsp')
        python_client = lsp.clients['python']
        qtbot.wait(5000)
    
        expected_requests = [
            'initialize',
            'initialized',
            'workspace/didChangeConfiguration',
            'workspace/didChangeWorkspaceFolders',
            'textDocument/didOpen',
        ]
    
        skip_intermediate = {
            'initialized': {'workspace/didChangeConfiguration'}
        }
    
        lsp_requests = python_client['instance']._requests
        start_idx = lsp_requests.index((0, 'initialize'))
    
        request_order = []
        expected_iter = iter(expected_requests)
        current_expected = next(expected_iter)
        for i in range(start_idx, len(lsp_requests)):
            if current_expected is None:
                break
    
            _, req_type = lsp_requests[i]
            if req_type == current_expected:
                request_order.append(req_type)
                current_expected = next(expected_iter, None)
            else:
                skip_set = skip_intermediate.get(current_expected, set({}))
                if req_type in skip_set:
                    continue
                else:
>                   assert req_type == current_expected
E                   AssertionError: assert 'textDocument/didChange' == 'textDocument/didOpen'
E                     - textDocument/didOpen
E                     ?                 ^^ -
E                     + textDocument/didChange
E                     ?                 ^^^^^

/tmp/autopkgtest-lxc.0c0pxmav/downtmp/build.gSC/src/spyder/app/tests/test_mainwindow.py:4098: AssertionError
----------------------------- Captured Qt messages -----------------------------
QtWarningMsg: Attribute Qt::AA_UseSoftwareOpenGL must be set before QCoreApplication is created.
QtWarningMsg: Scenegraph already initialized, setBackend() request ignored
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 
--------------------------- Captured stdout teardown ---------------------------
Python 3.9.12 (main, May 14 2022, 05:57:40) 
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

In [1]: 

I’m sometimes getting segfaults in test_mainwindow.py, but as ever, these are really hard to track down. I’m also sometimes getting timeouts in our testbed system (there’s a time limit of just under 3 hours). Other than that, things seem to be doing fine.

On i386, I’m still excluding test_mainwindow.py (as it regularly segfaults) and test_ipythonconsole.py (likewise), and also spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_hints as it repeatedly fails.

Best wishes, Julian

Hello, and sorry for the slow reply on this one. Here’s an update on this.

  • spyder/app/tests/test_mainwindow.py : I haven’t made any progress here, and am leaving it deselected for now. I ran the QtConsole test suite and it ran without any problems.
  • spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_hints: I’m just leaving this one deselected for now.
  • Flaky tests such as test_pdb_eventloop[inline]: they are indeed just flaky. I took your lead of running pytest multiple times, but used a slightly more sophisticated approach: I run pytest repeatedly until every (selected) test passes or xfails, up to a maximum of 5 times. Here’s the script I’ve written to do this; please feel free to take it! https://salsa.debian.org/science-team/spyder/-/blob/master/debian/tests/run_pytest.py
  • Debian’s CI setup runs the test suite on various architectures. It turns out that on i386 and armhf, spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py causes Python to crash. It’s not at a consistent test in this file, and sometimes Python crashes at a later test after these ones have run. I have no idea why, but I’m just skipping this file on these architectures now. I can give you parts of the logs if you would like. But as they’re not used much on desktops, I’m not sure if it’s worth the effort investigating further.
  • On armhf, there are also problems with spyder/plugins/pylint/tests/test_pylint.py::test_pylint_widget_pylintrc: this test fails with all 10 parameter options with timeouts on the qtbot.waitUntil call. Three other tests also fail:
    • spyder/plugins/editor/widgets/tests/test_completions_hide.py::test_automatic_completions_hide_complete fails repeatedly on the assertion assert completion.isHidden() - the value is False
    • spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_calltips[params0] (where params = ('dict', 'dict')) is flaky - it sometimes fails on the line: output_text = args[0]['signatures']['label'] with the error TypeError: 'NoneType' object is not subscriptable
    • spyder/plugins/editor/widgets/tests/test_introspection.py::test_automatic_completions fails on Python 3.10 at the qtbot.waitSignal call.

Best wishes, Julian

Closing because I think most of the problem reported here were already addressed.

Following on from the above, I’ve just investigated and opened https://github.com/spyder-ide/spyder/issues/19344

Hi all, here’s an update with 5.3.3 on amd64.

  • spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_hints (probably) still fails, but we know about that; I’m leaving it deselected.
  • spyder/app/tests/test_mainwindow.py::test_run_cython_code: this was working with 5.3.2, but has now stopped working. The failure log is not that helpful:
_____________________________ test_run_cython_code _____________________________

main_window = <spyder.app.mainwindow.MainWindow object at 0x7fdcb819dea0>
qtbot = <pytestqt.qtbot.QtBot object at 0x7fdc786aa050>

    @pytest.mark.slow
    @flaky(max_runs=3)
    @pytest.mark.skipif(
        (os.name == 'nt' or sys.platform == 'darwin' or
         parse_version(ipy_release.version) == parse_version('7.11.0')),
        reason="Hard to test on Windows and macOS and fails for IPython 7.11.0")
    def test_run_cython_code(main_window, qtbot):
        """Test all the different ways we have to run Cython code"""
        # Wait until the window is fully up
        shell = main_window.ipyconsole.get_current_shellwidget()
        qtbot.waitUntil(
            lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT)
    
        # ---- Setup ----
        # Get a reference to the code editor widget
        code_editor = main_window.editor.get_focus_widget()
    
        # ---- Run pyx file ----
        # Load test file
        main_window.editor.load(osp.join(LOCATION, 'pyx_script.pyx'))
    
        # Run file
        qtbot.keyClick(code_editor, Qt.Key_F5)
    
        # Get a reference to the namespace browser widget
        nsb = main_window.variableexplorer.current_widget()
    
        # Wait until an object appears
>       qtbot.waitUntil(lambda: nsb.editor.source_model.rowCount() == 1,
                        timeout=COMPILE_AND_EVAL_TIMEOUT)
E       pytestqt.exceptions.TimeoutError: waitUntil timed out in 30000 milliseconds

/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/test_mainwindow.py:1410: TimeoutError
----------------------------- Captured Qt messages -----------------------------
QtWarningMsg: Attribute Qt::AA_UseSoftwareOpenGL must be set before QCoreApplication is created.
QtWarningMsg: Scenegraph already initialized, setBackend() request ignored
---------------------------- Captured stdout setup -----------------------------
Attribute Qt::AA_UseSoftwareOpenGL must be set before QCoreApplication is created.
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests')

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests')

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests')

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests')

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests')

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests')

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests')

In [2]: 
--------------------------- Captured stdout teardown ---------------------------

In [1]: runfile('/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests/pyx_script.pyx', wdir='/tmp/autopkgtest-lxc.tyd2nkfj/downtmp/build.6sp/src/spyder/app/tests')

In [2]: 

Everything else is passing!

Hi @dalthviz, that sounds great, thanks!

Ah, I may have spoken in too much haste: spyder/plugins/editor/widgets/tests/test_hints_and_calltips.py::test_get_hints is still usually failing, even on amd64. I’ll leave it deselected.

Oh sorry @juliangilbey I think I didn’t explain things correctly 😅 I meant to say that maybe running the QtConsole test suit in your setup could help us see if there is something over QtConsole that needs to be fixed (since the Spyder test suit is failing when initializing the console widget which is code located at QtConsole). However, with the test you did, I think is clear that something inside the test suit is somehow faulty when reaching the QtConsole code. Maybe something related with pytest-qt or the creation of the QtApplication that is causing the segfault when the QtConsole code starts creating some actions 🤔

Hi @dalthviz, thanks! Lots of things to think about here!

Thanks @juliangilbey for the feedback! Regarding the test_mainwindow.py segfaults that’s something I’m checking as part of #17580 at #17622 but at least here on GitHub that problem could be being workarounded since for each job multiple attempts are contemplated (in the GitHub actions workflow we achieve this like this:

https://github.com/spyder-ide/spyder/blob/9f292bcd2d6b461dd79c04021fb11111f5644e24/.github/workflows/test-linux.yml#L127

Yes, I saw that; I didn’t particularly want to do this if I could help it, though!

Also, maybe something you can help us with this is running those tests with gdb in your setup (maybe with that we will be able to get some more info of the cause of the segfaults). For that you can run something like this:

https://github.com/spyder-ide/spyder/blob/9f292bcd2d6b461dd79c04021fb11111f5644e24/.github/workflows/test-linux.yml#L123

Here’s the output of running this:

euler:~/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1 $ CI=TRUE HOME=/tmp/homedir xvfb-run --auto-servernum gdb -return-child-result -batch -ex r -ex py-bt --args python3.10 runtests.py --homedir=/tmp/homedir --run-slow 'spyder/app/tests/test_mainwindow.py'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Pytest Arguments: ['-vv', '-rw', '--durations=10', '-W ignore::UserWarning', '--run-slow', 'spyder/app/tests/test_mainwindow.py']
============================= test session starts ==============================
platform linux -- Python 3.10.4, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /usr/bin/python3.10
cachedir: .pytest_cache
PySide2 5.15.2 -- Qt runtime 5.15.2 -- Qt compiled 5.15.2
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/.hypothesis/examples')
rootdir: /home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1, configfile: pytest.ini
plugins: lazy-fixture-0.6.3, xdist-2.5.0, anyio-3.5.0, order-1.0.1, mock-3.6.1, forked-1.4.0, cov-3.0.0, timeout-2.1.0, qt-4.0.2, dependency-0.5.1, flaky-3.7.0, hypothesis-6.36.0
collecting ... [New Thread 0x7fffd1ec9640 (LWP 425952)]
[New Thread 0x7fffd16c8640 (LWP 425953)]
[New Thread 0x7fffc0ec7640 (LWP 425954)]
[New Thread 0x7fffc06c6640 (LWP 425955)]
[New Thread 0x7fffafec5640 (LWP 425956)]
[New Thread 0x7fffaf6c4640 (LWP 425957)]
[New Thread 0x7fff9eec3640 (LWP 425958)]
[New Thread 0x7fff9e6c2640 (LWP 425959)]
[New Thread 0x7fff8dec1640 (LWP 425960)]
[New Thread 0x7fff856c0640 (LWP 425961)]
[New Thread 0x7fff84ebf640 (LWP 425962)]
[New Thread 0x7fff746be640 (LWP 425963)]
[New Thread 0x7fff6bebd640 (LWP 425964)]
[New Thread 0x7fff636bc640 (LWP 425965)]
[New Thread 0x7fff5aebb640 (LWP 425966)]
[New Thread 0x7fff5a6ba640 (LWP 425967)]
[New Thread 0x7fff49eb9640 (LWP 425968)]
[New Thread 0x7fff416b8640 (LWP 425969)]
[New Thread 0x7fff38eb7640 (LWP 425970)]
[New Thread 0x7fff386b6640 (LWP 425971)]
[New Thread 0x7fff27eb5640 (LWP 425972)]
[New Thread 0x7fff1f6b4640 (LWP 425973)]
[New Thread 0x7fff1eeb3640 (LWP 425974)]
[New Thread 0x7fff166b2640 (LWP 425975)]
[New Thread 0x7fff05eb1640 (LWP 425976)]
[New Thread 0x7ffefd6b0640 (LWP 425977)]
[New Thread 0x7ffef4eaf640 (LWP 425978)]
[New Thread 0x7ffeec6ae640 (LWP 425979)]
[New Thread 0x7ffee3ead640 (LWP 425980)]
[New Thread 0x7ffedb6ac640 (LWP 425981)]
[New Thread 0x7ffed2eab640 (LWP 425982)]
[Detaching after vfork from child process 425993]
[Detaching after vfork from child process 425994]
collected 108 items                                                            

spyder/app/tests/test_mainwindow.py::test_single_instance_and_edit_magic [New Thread 0x7ffec6e94640 (LWP 426111)]
[New Thread 0x7ffec5586640 (LWP 426140)]
[New Thread 0x7ffec4d85640 (LWP 426141)]
[New Thread 0x7ffeb6e94640 (LWP 426142)]
[New Thread 0x7ffeb6693640 (LWP 426143)]
[New Thread 0x7ffeb5e92640 (LWP 426144)]
[New Thread 0x7ffeb5691640 (LWP 426145)]
[New Thread 0x7ffeb4e90640 (LWP 426146)]
[New Thread 0x7ffe97fff640 (LWP 426147)]
[New Thread 0x7ffe977fe640 (LWP 426148)]
[New Thread 0x7ffe96ffd640 (LWP 426149)]
[New Thread 0x7ffe967fc640 (LWP 426151)]
[New Thread 0x7ffe95ffb640 (LWP 426152)]
[New Thread 0x7ffe957fa640 (LWP 426153)]
[New Thread 0x7ffe94ff9640 (LWP 426154)]
[New Thread 0x7ffe77fff640 (LWP 426155)]
[New Thread 0x7ffe6ffff640 (LWP 426156)]
[New Thread 0x7ffe777fe640 (LWP 426157)]
[New Thread 0x7ffe76ffd640 (LWP 426158)]
[New Thread 0x7ffe767fc640 (LWP 426159)]
[New Thread 0x7ffe75ffb640 (LWP 426160)]
[New Thread 0x7ffe757fa640 (LWP 426161)]
[New Thread 0x7ffe74ff9640 (LWP 426162)]
[New Thread 0x7ffe6f7fe640 (LWP 426163)]
[New Thread 0x7ffe6effd640 (LWP 426164)]
[New Thread 0x7ffe6e7fc640 (LWP 426165)]
[New Thread 0x7ffe6dffb640 (LWP 426166)]
[New Thread 0x7ffe6d7fa640 (LWP 426167)]
[New Thread 0x7ffe6cff9640 (LWP 426168)]
[New Thread 0x7ffe37fff640 (LWP 426169)]
[New Thread 0x7ffe2ffff640 (LWP 426170)]
[New Thread 0x7ffe377fe640 (LWP 426171)]
[New Thread 0x7ffe36ffd640 (LWP 426172)]
[New Thread 0x7ffe367fc640 (LWP 426176)]
[New Thread 0x7ffe35ffb640 (LWP 426182)]
[New Thread 0x7ffe357fa640 (LWP 426183)]
[New Thread 0x7ffe34ff9640 (LWP 426187)]
[Detaching after vfork from child process 426190]
[New Thread 0x7ffe2ecfe640 (LWP 426236)]
[New Thread 0x7ffe2dfc0640 (LWP 426237)]
[Detaching after fork from child process 426238]
[Thread 0x7ffed2eab640 (LWP 425982) exited]
[Thread 0x7ffedb6ac640 (LWP 425981) exited]
[Thread 0x7ffee3ead640 (LWP 425980) exited]
[Thread 0x7ffeec6ae640 (LWP 425979) exited]
[Thread 0x7ffef4eaf640 (LWP 425978) exited]
[Thread 0x7ffefd6b0640 (LWP 425977) exited]
[Thread 0x7fff05eb1640 (LWP 425976) exited]
[Thread 0x7fff166b2640 (LWP 425975) exited]
[Thread 0x7fff1eeb3640 (LWP 425974) exited]
[Thread 0x7fff1f6b4640 (LWP 425973) exited]
[Thread 0x7fff27eb5640 (LWP 425972) exited]
[Thread 0x7fff386b6640 (LWP 425971) exited]
[Thread 0x7fff38eb7640 (LWP 425970) exited]
[Thread 0x7fff416b8640 (LWP 425969) exited]
[Thread 0x7fff49eb9640 (LWP 425968) exited]
[Thread 0x7fff5a6ba640 (LWP 425967) exited]
[Thread 0x7fff5aebb640 (LWP 425966) exited]
[Thread 0x7fff636bc640 (LWP 425965) exited]
[Thread 0x7fff6bebd640 (LWP 425964) exited]
[Thread 0x7fff746be640 (LWP 425963) exited]
[Thread 0x7fff84ebf640 (LWP 425962) exited]
[Thread 0x7fff856c0640 (LWP 425961) exited]
[Thread 0x7fff8dec1640 (LWP 425960) exited]
[Thread 0x7fff9e6c2640 (LWP 425959) exited]
[Thread 0x7fff9eec3640 (LWP 425958) exited]
[Thread 0x7fffaf6c4640 (LWP 425957) exited]
[Thread 0x7fffafec5640 (LWP 425956) exited]
[Thread 0x7fffc06c6640 (LWP 425955) exited]
[Thread 0x7fffc0ec7640 (LWP 425954) exited]
[Thread 0x7fffd16c8640 (LWP 425953) exited]
[Thread 0x7fffd1ec9640 (LWP 425952) exited]
[Detaching after fork from child process 426239]
[Detaching after fork from child process 426240]
[New Thread 0x7ffed2eab640 (LWP 426245)]
[New Thread 0x7ffedb6ac640 (LWP 426246)]
[New Thread 0x7ffee3ead640 (LWP 426247)]
[New Thread 0x7ffeec6ae640 (LWP 426248)]
[New Thread 0x7fffd1ec9640 (LWP 426249)]
[New Thread 0x7fffd16c8640 (LWP 426250)]
[New Thread 0x7fffc0ec7640 (LWP 426251)]
[New Thread 0x7fffc06c6640 (LWP 426252)]
[New Thread 0x7fffafec5640 (LWP 426253)]
[New Thread 0x7fffaf6c4640 (LWP 426254)]
[New Thread 0x7fff9eec3640 (LWP 426255)]
[New Thread 0x7fff9e6c2640 (LWP 426256)]
[New Thread 0x7fff856c0640 (LWP 426257)]
[New Thread 0x7fff84ebf640 (LWP 426258)]
[New Thread 0x7fff746be640 (LWP 426302)]
[Detaching after vfork from child process 426303]
[New Thread 0x7fff6bebd640 (LWP 426318)]
[New Thread 0x7fff636bc640 (LWP 426319)]
[New Thread 0x7fff5aebb640 (LWP 426320)]
[New Thread 0x7fff5a6ba640 (LWP 426321)]
[Thread 0x7fff5aebb640 (LWP 426320) exited]
[Thread 0x7fff746be640 (LWP 426302) exited]
[Detaching after vfork from child process 426349]
[Detaching after vfork from child process 426353]
[New Thread 0x7fff746be640 (LWP 426354)]
[New Thread 0x7fff5aebb640 (LWP 426355)]
[Detaching after vfork from child process 426359]
[New Thread 0x7fff416b8640 (LWP 426360)]
[New Thread 0x7fff38eb7640 (LWP 426361)]
[New Thread 0x7fff386b6640 (LWP 426380)]

Thread 1 "python3.10" received signal SIGSEGV, Segmentation fault.
0x00007ffff740b17d in ?? () from /usr/lib/python3/dist-packages/PyQt5/sip.cpython-310-x86_64-linux-gnu.so
Traceback (most recent call first):
  File "/usr/lib/python3/dist-packages/qtconsole/console_widget.py", line 342, in __init__
    self.increase_font_size = QtWidgets.QAction("Bigger Font",
  File "/usr/lib/python3/dist-packages/qtconsole/history_console_widget.py", line 27, in __init__
    super().__init__(*args, **kw)
  File "/usr/lib/python3/dist-packages/qtconsole/frontend_widget.py", line 165, in __init__
    super().__init__(*args, **kw)
  File "/usr/lib/python3/dist-packages/qtconsole/jupyter_widget.py", line 118, in __init__
    super().__init__(*args, **kw)
  File "/usr/lib/python3/dist-packages/qtconsole/rich_jupyter_widget.py", line 55, in __init__
    super().__init__(*args, **kw)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/debugging.py", line 75, in __init__
    super(DebuggingHistoryWidget, self).__init__(*args, **kwargs)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/debugging.py", line 195, in __init__
    super(DebuggingWidget, self).__init__(*args, **kwargs)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/shell.py", line 119, in __init__
    super(ShellWidget, self).__init__(*args, **kw)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/client.py", line 146, in __init__
    self.shellwidget = ShellWidget(
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/widgets/main_widget.py", line 1548, in create_new_client
    client = ClientWidget(self, id_=client_id,
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/plugin.py", line 521, in create_new_client
    self.get_widget().create_new_client(
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/plugins/ipythonconsole/plugin.py", line 389, in on_mainwindow_visible
    self.create_new_client(give_focus=False)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/mainwindow.py", line 1169, in post_visible_setup
    plugin.on_mainwindow_visible()
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/utils.py", line 300, in create_window
    main.post_visible_setup()
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/mainwindow.py", line 1989, in main
    window = create_window(MainWindow, app, None, options, None)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/start.py", line 234, in main
    return mainwindow.main(options, args)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/spyder/app/tests/test_mainwindow.py", line 331, in main_window
    window = start.main()
  <built-in method next of module object at remote 0x7ffff7b3c5e0>
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 925, in call_fixture_func
    fixture_result = next(generator)
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 1126, in pytest_fixture_setup
    result = call_fixture_func(fixturefunc, request, kwargs)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 1072, in execute
    result = hook.pytest_fixture_setup(fixturedef=self, request=request)
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 687, in _compute_fixture_value
    fixturedef.execute(request=subrequest)
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 601, in _get_active_fixturedef
    self._compute_fixture_value(fixturedef)
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 581, in getfixturevalue
    fixturedef = self._get_active_fixturedef(argname)
  File "/usr/lib/python3/dist-packages/_pytest/fixtures.py", line 568, in _fillfixtures
    item.funcargs[argname] = self.getfixturevalue(argname)
  File "/usr/lib/python3/dist-packages/pytest_lazyfixture.py", line 39, in fill
    _fillfixtures()
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1647, in setup
    self._request._fillfixtures()
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 449, in prepare
    col.setup()
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 150, in pytest_runtest_setup
    item.session._setupstate.prepare(item)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 255, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 311, in from_call
    result: Optional[TResult] = func()
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 254, in call_runtest_hook
    return CallInfo.from_call(
  File "/usr/lib/python3/dist-packages/flaky/flaky_pytest_plugin.py", line 138, in call_and_report
    call = call_runtest_hook(item, when, **kwds)
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 120, in runtestprotocol
    rep = call_and_report(item, "setup", log)
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 109, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/usr/lib/python3/dist-packages/flaky/flaky_pytest_plugin.py", line 94, in pytest_runtest_protocol
    self.runner.pytest_runtest_protocol(item, nextitem)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 348, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 323, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 269, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/usr/lib/python3/dist-packages/_pytest/main.py", line 316, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 162, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 48, in run_pytest
    errno = pytest.main(pytest_args)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 78, in main
    run_pytest(run_slow=test_args.run_slow, extra_args=pytest_args)
  File "/home/jdg/debian/spyder-packages/spyder/build-area/spyder-5.3.0+dfsg1/runtests.py", line 82, in <module>
    main()

I hope there’s something useful here.

Regarding test_get_hints, I would say that marking it as flaky with something like @flaky(max_runs=3) could work +1 At #17622 I did that with a test from the code analysis/pylint plugin

OK, I tried that, but with no success. So I’ll just skip it.

Regarding test_pdb_eventloop[inline], I would say that marking as flaky could help since the error shows something related to ZMQ and the heartbeat channel socket unable to be binded to an address which could be caused due to the kernel taking to much time to start as @ccordoba12 suggested.

OK; I’m instead extending the timeouts everywhere, as that seems a more robust approach.

Regarding test_pdb_out seems like is more clearly related to debugpy since the error shown indicates that debugging will not be enabled due to something related to debugpy not being defined (maybe @impact27 knows better about this kind of warning message):

[SpyderKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled

I don’t think so, as it runs fine on my machine and the error message was about timeouts again. I’m extending the timeout; we’ll see if that helps.

Best wishes, Julian