Layout test flakiness: 'window' is null and reported error line number seems incorrect |
|||
Issue description
While running layout tests locally (Linux 64-bits workstation) I found test fast/images/image-zoom-to-500.html [1] to be flaky. Most times when running all tests in fast/ or fast/images/ it failed the text diff because of this console message (see attached image for the ):
CONSOLE ERROR: line 37: Uncaught TypeError: Cannot read property 'eventSender' of null
This is a relevant code snippet from that file:
36: if (window.eventSender) {
37: eventSender.zoomPageIn();
I initially (and logically) thought the error came from line 37 as the message stated, where eventSender is accessed from the global scope level. But after discussions and running tests to understand what triggers that console message it seems that in fact the error happens in line 36 and it's 'window' that is somehow null.
So two things seem to be broken here:
- How can window be null? I'm not knowledgeable enough on javascript to know if that's to be expected.
- Why is the error message apparently reporting the wrong line?
To reproduce this I suggest running:
cr build blink_tests content_shell && third_party/WebKit/Tools/Scripts/run-webkit-tests --release --no-show-results --no-retry-failures fast/images/
[1] https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/fast/images/image-zoom-to-500.html
,
Jul 11 2016
reduced repro steps: out/Release/content_shell --run-layout-test fast/images/image-zoom-to-25.html fast/images/image-zoom-to-500.html
,
Jul 11 2016
The error is actually from the image-zoom-to-25.html test which happens to have the if (window.eventSender) in the same line
,
Jul 11 2016
,
Jul 11 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/74a3e66f56274c9d970e9c20aef86df3da7e73d1 commit 74a3e66f56274c9d970e9c20aef86df3da7e73d1 Author: jochen <jochen@chromium.org> Date: Mon Jul 11 12:31:53 2016 Deflake image-zoom-to-{25,500}.html Before finishing the test, remove the resize event listener, as we just resized, and the window is about to be closed. Otherwise, we might get spurious output from the event listener running in a detached context BUG= 627030 R=haraken@chromium.org,carlosk@chromium.org Review-Url: https://codereview.chromium.org/2141573002 Cr-Commit-Position: refs/heads/master@{#404638} [modify] https://crrev.com/74a3e66f56274c9d970e9c20aef86df3da7e73d1/third_party/WebKit/LayoutTests/fast/images/image-zoom-to-25.html [modify] https://crrev.com/74a3e66f56274c9d970e9c20aef86df3da7e73d1/third_party/WebKit/LayoutTests/fast/images/image-zoom-to-500.html |
|||
►
Sign in to add a comment |
|||
Comment 1 by jochen@chromium.org
, Jul 11 2016