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

Running pytest-qt with pytest-xvfb and importing QWebEnginePage leads to an X11 error in Github Actions #490

Closed
sanjacob opened this issue May 27, 2023 · 2 comments

Comments

@sanjacob
Copy link

Bug description

Running pytest-qt with pytest-xvfb and importing QWebEnginePage leads to an X11 error in Github Actions
(ubuntu-latest).

Run pytest -vvvv
  
============================= test session starts ==============================
platform linux -- Python 3.10.11, pytest-7.3.1, pluggy-1.0.0 -- /opt/hostedtoolcache/Python/3.10.11/x64/bin/python
cachedir: .pytest_cache
PyQt5 5.15.9 -- Qt runtime 5.15.2 -- Qt compiled 5.15.2
rootdir: /home/runner/work/test-ga-pyqt-test/test-ga-pyqt-test
plugins: xvfb-2.0.0, qt-4.2.0
collecting ... collected 1 item

tests/test_qt.py::TestWorkflow::test_workflow_error PASSED               [100%]

============================== 1 passed in 0.63s ===============================
The X11 connection broke: I/O error (code 1)
XIO:  fatal IO error 0 (Success) on X server ":0"
      after 375 requests (373 known processed) with 0 events remaining.
Error: Process completed with exit code 1.

To Reproduce

To be run with pytest-xvfb:

import pytest
from PyQt5.QtWebEngineWidgets import QWebEnginePage
from PyQt5.QtWidgets import QWidget

class TestWorkflow:

    def test_workflow_error(self, qtbot):
        widget = QWidget()
        qtbot.addWidget(widget)
        widget.show()
        assert widget.isVisible()
@sanjacob
Copy link
Author

sanjacob commented May 27, 2023

You can see a proof of concept on this repo: jacobszpz/test-ga-pyqt-test

@The-Compiler
Copy link
Member

This doesn't seem like a pytest-qt issue, as it reproduces with just this:

import pytest

import sys
from PyQt5.QtWebEngineWidgets import QWebEnginePage
from PyQt5.QtWidgets import QWidget, QApplication

app = QApplication(sys.argv)

def test_widget():
    widget = QWidget()
    widget.show()

Assuming it's some sort of pytest-xvfb issue, though I'm still puzzled what's going on exactly. The-Compiler/pytest-xvfb#11 would probably the right place to continue this.

@The-Compiler The-Compiler closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2023
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

2 participants