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

test_set_error in test_stylesheet.py is flaky #3771

Open
The-Compiler opened this issue Mar 26, 2018 · 0 comments
Open

test_set_error in test_stylesheet.py is flaky #3771

The-Compiler opened this issue Mar 26, 2018 · 0 comments
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. component: tests Issues related to the testsuite. language: javascript Issues which require knowing JavaScript. priority: 1 - middle Issues which should be done at some point, but aren't that important.

Comments

@The-Compiler
Copy link
Member

Something around 460bd86 broke this, see e.g. https://travis-ci.org/qutebrowser/qutebrowser/jobs/358119004:

[...]
----------------------------- Captured stderr call -----------------------------
Qt exceptions in virtual methods:
________________________________________________________________________________
Traceback (most recent call last):
  File "/home/user/qutebrowser.git/qutebrowser/browser/webengine/webview.py", line 292, in javaScriptConsoleMessage
    shared.javascript_log_message(level_map[level], source, line, msg)
  File "/home/user/qutebrowser.git/qutebrowser/browser/shared.py", line 146, in javascript_log_message
    logger(logstring)
  File "/usr/lib64/python3.6/logging/__init__.py", line 1335, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib64/python3.6/logging/__init__.py", line 1442, in _log
    self.handle(record)
  File "/usr/lib64/python3.6/logging/__init__.py", line 1452, in handle
    self.callHandlers(record)
  File "/usr/lib64/python3.6/logging/__init__.py", line 1514, in callHandlers
    hdlr.handle(record)
  File "/usr/lib64/python3.6/logging/__init__.py", line 863, in handle
    self.emit(record)
  File "/home/user/qutebrowser.git/tests/helpers/logfail.py", line 51, in emit
    record.getMessage()))
  File "/home/user/qutebrowser.git/.tox/py36/lib/python3.6/site-packages/_pytest/outcomes.py", line 92, in fail
    raise Failed(msg=msg, pytrace=pytrace)
Failed: Got logging message on logger js with level ERROR: [:1] Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.!
________________________________________________________________________________
------------------------------ Captured log call -------------------------------
config.py                  287 DEBUG    Config option changed: content.user_stylesheets = /home/user/qutebrowser.git/tests/unit/javascript/stylesheet/green.css
browsertab.py              732 DEBUG    Predicted navigation: file:///home/user/qutebrowser.git/tests/unit/javascript/non-existent.html
browsertab.py              732 DEBUG    Predicted navigation: file:///home/user/qutebrowser.git/tests/unit/javascript/non-existent.html
objreg.py                  121 DEBUG    schedule removal: 21
objreg.py                  121 DEBUG    schedule removal: tab
objreg.py                  121 DEBUG    schedule removal: hintmanager
objreg.py                  126 DEBUG    removed: 21
objreg.py                  126 DEBUG    removed: tab
objreg.py                  126 DEBUG    removed: hintmanager
browsertab.py              704 DEBUG    load status for <qutebrowser.browser.webengine.webenginetab.WebEngineTab tab_id=22 url='file:///home/user/qutebrowser.git/tests/unit/javascript/non-existent.html'>: LoadStatus.loading
browsertab.py              756 DEBUG    navigation request: url file:///home/user/qutebrowser.git/tests/unit/javascript/non-existent.html, type Type.typed, is_main_frame True
browsertab.py              704 DEBUG    load status for <qutebrowser.browser.webengine.webenginetab.WebEngineTab tab_id=22 url='file:///home/user/qutebrowser.git/tests/unit/javascript/non-existent.html'>: LoadStatus.success
shared.py                  146 INFO     [:1] null

It looks like document.documentElement is null at the point the JS is getting run. I've tried some ideas to stabilize it, but they didn't help. Probably the JS running needs to be delayed a bit more...

cc @jgkamat, though I broke it, so feel free to ignore it 😉

@The-Compiler The-Compiler added component: tests Issues related to the testsuite. priority: 0 - high Issues which are currently the primary focus. language: javascript Issues which require knowing JavaScript. bug: behavior Something doesn't work as intended, but doesn't crash. labels Mar 26, 2018
The-Compiler added a commit that referenced this issue Apr 16, 2018
@The-Compiler The-Compiler added priority: 1 - middle Issues which should be done at some point, but aren't that important. and removed priority: 0 - high Issues which are currently the primary focus. labels Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: behavior Something doesn't work as intended, but doesn't crash. component: tests Issues related to the testsuite. language: javascript Issues which require knowing JavaScript. priority: 1 - middle Issues which should be done at some point, but aren't that important.
Projects
None yet
Development

No branches or pull requests

1 participant