Skip to content

Test fails with ignored Qt warning #97

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

Closed
The-Compiler opened this issue Oct 10, 2015 · 3 comments
Closed

Test fails with ignored Qt warning #97

The-Compiler opened this issue Oct 10, 2015 · 3 comments

Comments

@The-Compiler
Copy link
Member

I have no idea what's going on... Looking at e.g. this build, the tests fail because of a Qt message:

=================================== FAILURES ===================================
_____________________ test_err_windows[''-''-'exception'] ______________________
tests/unit/utils/test_error.py:75: Failure: Qt messages with level WARNING or above emitted
----------------------------- Captured Qt messages -----------------------------
None:None:0:
    QtWarningMsg: virtual void QSslSocketBackendPrivate::transmit() SSLRead failed with: -9805
None:None:0:
    QtWarningMsg: virtual void QSslSocketBackendPrivate::transmit() SSLRead failed with: -9805
None:None:0:
    QtWarningMsg: virtual void QSslSocketBackendPrivate::transmit() SSLRead failed with: -9805
None:None:0:
    QtWarningMsg: virtual void QSslSocketBackendPrivate::transmit() SSLRead failed with: -9805
None:None:0:
    QtWarningMsg: virtual void QSslSocketBackendPrivate::transmit() SSLRead failed with: -9805
None:None:0:
    QtWarningMsg: virtual void QSslSocketBackendPrivate::transmit() SSLRead failed with: -9805

However, this exact message is ignored in my pytest.ini:

qt_log_ignore =
    ^SpellCheck: .*
    ^SetProcessDpiAwareness failed: .*
    ^QWindowsWindow::setGeometryDp: Unable to set geometry .*
    ^QProcess: Destroyed while process .* is still running\.
    ^"Method "GetAll" with signature "s" on interface "org\.freedesktop\.DBus\.Properties" doesn't exist
    ^virtual void QSslSocketBackendPrivate::transmit\(\) SSL write failed with error: -9805
    ^virtual void QSslSocketBackendPrivate::transmit\(\) SSLRead failed with: -9805

Unfortunately I can't trigger the message reliably. When I write a test which uses the same message with a qWarning, it passes:

def test_suppressed_qwarning():
    qWarning("virtual void QSslSocketBackendPrivate::transmit() SSLRead failed with: -9805")

So I wonder what's going on... any idea?

@nicoddemus
Copy link
Member

Hmmm I just reviewed the relevant code and it seems correct to me. 😕

Some ideas:

  1. Try loosing up the regex a bit, for example ".*QSslSocketBackendPrivate::transmit.*SSLRead failed with:.*-9805... perhaps there's some hidden white-space in the original message; The fact that the messages don't have the (IGNORED) prefix means that the regex is not matching somehow.
  2. Try printing request.config.getini('qt_log_ignore') from inside the test to see if the regex are correct.

That's all I can think of at the moment...

@The-Compiler
Copy link
Member Author

Oh, that test has a qt_log_ignore marker and reading the code I realized the regexes listed there overwrite the ones in the config rather than extending them (like I'd've expected). Though the documentation clearly states the right thing 😉

What do you think about adding some extend=True parameter to the qt_log_ignore marker?

@nicoddemus
Copy link
Member

That's a good idea. Would you mind creating an issue? (I'm on my mobile right now)

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