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

Lots of "XIO: fatal IO error 0 (Success)" errors when running tests under Xvfb #17085

Closed
5 of 10 tasks
juliangilbey opened this issue Dec 23, 2021 · 6 comments
Closed
5 of 10 tasks
Assignees
Milestone

Comments

@juliangilbey
Copy link
Contributor

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

When I run the whole test suite or almost any collection of tests within it under xvfb (as I have to in the non-interactive testing autopkgtest environment), I consistently get an error at the very end like the following:

The X11 connection broke: I/O error (code 1)
XIO:  fatal IO error 22 (Invalid argument) on X server ":30"
      after 62939 requests (62933 known processed) with 0 events remaining.
QObject::~QObject: Timers cannot be stopped from another thread

That means that I can't actually determine easily whether the tests have been successful or not, as this error causes pytest to exit with an error code whether or not all of the individual tests have passed; this is clearly a spurious error. It is also well-known: The-Compiler/pytest-xvfb#11. The best suggestion there so far is to ensure that all windows are closed before finishing the test. This probably affects hundreds of the tests in the spyder test suite, so I wonder whether there is an easy way to close all open windows in conftest.py, perhaps using some sort of general teardown function that applies to every test? I don't yet know enough about how qtbot etc works to be able to do this myself, I'm afraid, but it would be a right pain to have to modify every single test to achieve this. Do you have any ideas?

What steps reproduce the problem?

CI=true xvfb-run -a -s "-screen 0 1024x768x24 +extension GLX" python3.9 runtests.py

(possibly with some tests excluded; I also have to specify the HOME directory and some other inconsequential tweaks).

A smaller example is this; here /tmp/tmp.lzQBAqxWji is a temporary initially-empty directory created for this set of tests:

(sid-minimal)jdg@euler:/build/spyder-jdg/build-area/spyder-5.2.1+dfsg1$ HOME=/tmp/tmp.IzQBAqxWjj xvfb-run -a -s "-screen 0 1024x768x24 +extension GLX" python3.10 runtests.py spyder/plugins/shortcuts/tests
Pytest Arguments: ['-vv', '-rw', '--durations=10', '-W ignore::UserWarning', 'spyder/plugins/shortcuts/tests']
============================= test session starts ==============================
platform linux -- Python 3.10.1, pytest-6.2.5, py-1.10.0, pluggy-0.13.0 -- /usr/bin/python3.10
cachedir: .pytest_cache
PyQt5 5.15.6 -- Qt runtime 5.15.2 -- Qt compiled 5.15.2
rootdir: /build/spyder-jdg/build-area/spyder-5.2.1+dfsg1, configfile: pytest.ini
plugins: flaky-3.7.0, xvfb-2.0.0, mock-3.6.1, cov-3.0.0, order-1.0.0, qt-4.0.2, lazy-fixture-0.6.3
collected 13 items                                                             

spyder/plugins/shortcuts/tests/test_shortcuts.py::test_shortcuts PASSED  [  7%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_shortcut_in_conf_is_filtered_with_shortcut_data PASSED [ 15%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_shortcuts_filtering PASSED [ 23%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_shortcut_filtering_context PASSED [ 30%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_clear_shortcut PASSED [ 38%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_press_new_sequence PASSED [ 46%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_press_new_compound_sequence PASSED [ 53%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_clear_back_new_sequence PASSED [ 61%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_sequence_conflict PASSED [ 69%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_sequence_single_key PASSED [ 76%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_set_sequence_to_default PASSED [ 84%]
spyder/plugins/shortcuts/tests/test_shortcuts.py::test_invalid_char_in_sequence PASSED [ 92%]
spyder/plugins/shortcuts/tests/test_shortcuts_config_dialog.py::test_config_dialog[config_dialog0] PASSED [100%]

============================= slowest 10 durations =============================
0.21s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_shortcuts
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts_config_dialog.py::test_config_dialog[config_dialog0]
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_shortcuts_filtering
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_set_sequence_to_default
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_shortcut_filtering_context
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_sequence_conflict
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_press_new_compound_sequence
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_clear_back_new_sequence
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_sequence_single_key
0.05s setup    spyder/plugins/shortcuts/tests/test_shortcuts.py::test_press_new_sequence
============================== 13 passed in 1.65s ==============================
The X11 connection broke: I/O error (code 1)
XIO:  fatal IO error 0 (Success) on X server ":30"
      after 1206 requests (1198 known processed) with 0 events remaining.

Versions

  • Spyder version: 5.2.1
  • Python version: 3.9 and 3.10
  • Qt version: 5.15.2
  • PyQt version: 5.15.6+dfsg-1+b1
  • Operating System name/version: Debian testing and 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.6.0               :  7.27.0 (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.3.0 (OK)
nbconvert >=4.0               :  6.1.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (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.8.0 (OK)
pygments >=2.0                :  2.7.1 (OK)
pylint >=2.5.0                :  2.12.2 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.3.2;<1.4.0          :  1.3.3 (OK)
pylsp_black >=1.0.0           :  1.0.1 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.1.1 (OK)
qtconsole >=5.2.1;<5.3.0      :  5.2.1 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  58.2.0 (OK)
sphinx >=0.6.6                :  4.3.2 (OK)
spyder_kernels >=2.2.0;<2.3.0 :  2.2.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.6 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  0.29.24 (OK)
matplotlib >=2.0.0            :  3.3.4 (OK)
numpy >=1.7                   :  1.21.5 (OK)
pandas >=1.1.1                :  1.3.4 (OK)
scipy >=0.17.0                :  1.7.1 (OK)
sympy >=0.7.3                 :  1.7.1 (OK)
@ccordoba12
Copy link
Member

This will be fixed once we manage to make our test suite pass with PyQt 5.15.

@ccordoba12 ccordoba12 added this to the v5.3.0 milestone Dec 25, 2021
@ccordoba12 ccordoba12 self-assigned this Dec 25, 2021
@juliangilbey
Copy link
Contributor Author

That will be amazing, thanks! Most of the test suite does pass already with PyQt 5.15.2, as I have discovered; I think I've reported all of the "obviously" failing tests. Please do let me know if there's anything I can do to help; once the nbconvert bug (jupyter/nbconvert#1685) is resolved, it would be great to get Spyder 5.x into Debian!

@admanero
Copy link

Hi

just recently I learnt of spyder python IDE. I was quite impressed with the layout and its functionality and its ipython console. However when I tried running it remotely executed from my CentOS machine connected from my ubuntu notebook I get the following error:

(20:37 admpy@ThermalBox anaconda3) > bin/spyder
The X11 connection broke: No error (code 0)
XIO: fatal IO error 0 (Success) on X server "localhost:10.0"
after 426 requests (426 known processed) with 0 events remaining.

  this is with Spyder 5.2.2
  
Which is the same error listed in this issue. Will this be fixed when spyder supports PyQt5 5.15 ? 

Thanks

@dalthviz
Copy link
Member

dalthviz commented Mar 3, 2022

Hi @juliangilbey I was checking this and seems like uninstalling or deactivating pytest-xvfb prevents showing the message. I think the reason why the fatal IO error 0 messages are not showing in our CI is because we are uninstalling it:

# Remove pytest-xvfb because it causes hangs
pip uninstall -q -y pytest-xvfb

Could you check if that helps?

Also, hi @admanero thank you for your feeback! I'm not totally sure but maybe it could be caused by the Spyder screen resolution preferences set on your CentOS machine. It could be also related with incompatibility with drivers or graphics cards as in #8057 . If you get any other info let us know!

@juliangilbey
Copy link
Contributor Author

Hi @dalthviz - thanks, that's it exactly - good catch! Removing pytest-xvfb from the environment resolves this issue. So this issue can be closed as far as I am concerned.

@ccordoba12
Copy link
Member

It'll be closed when PR #16409 is merged.

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

No branches or pull requests

4 participants