Bug 178828 - LayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html is a flaky failure
Summary: LayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-25 14:04 PDT by Ryan Haddad
Modified: 2017-10-27 01:39 PDT (History)
6 users (show)

See Also:


Attachments
Removes the superflous call to finishJSTest (1.40 KB, patch)
2017-10-25 21:07 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Another fix (2.17 KB, patch)
2017-10-26 12:57 PDT, Ryosuke Niwa
wenson_hsieh: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Haddad 2017-10-25 14:04:57 PDT
LayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html is a flaky failure

https://build.webkit.org/results/Apple%20iOS%2011%20Simulator%20Debug%20WK2%20(Tests)/r223962%20(616)/results.html
https://build.webkit.org/results/Apple%20El%20Capitan%20Release%20WK2%20(Tests)/r223850%20(5426)/results.html

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2Fsecurity%2Fclipboard%2Fcopy-paste-html-cross-origin-iframe-across-origin.html

--- /Volumes/Data/slave/ios-simulator-11-debug-tests-wk2/build/layout-test-results/http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin-expected.txt
+++ /Volumes/Data/slave/ios-simulator-11-debug-tests-wk2/build/layout-test-results/http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin-actual.txt
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: line 30: Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'frame.contentDocument.body.innerHTML')
 This tests copying and pasting HTML by the default action. WebKit should sanitize the HTML across origin.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -9,16 +10,11 @@
 PASS new URL(img.src).protocol is "blob:"
 PASS new URL(fragment.querySelector(".same-origin-frame").src).protocol is "blob:"
 PASS new URL(fragment.querySelector(".cross-origin-frame").src).protocol is "blob:"
-PASS frames.length is 2
-PASS new URL(frames[0].src).protocol is "blob:"
-PASS frames[0].canAccessContentDocument is true
-PASS frames[0].hasImage is true
-PASS frames[0].imageWidth is 80
-PASS new URL(frames[1].src).protocol is "blob:"
-PASS frames[1].canAccessContentDocument is true
-PASS frames[1].hasImage is true
-PASS frames[1].imageWidth is 80
 PASS successfullyParsed is true
 
 TEST COMPLETE
+Copy
 
+hello,  
+  
+
Comment 1 Radar WebKit Bug Importer 2017-10-25 19:23:33 PDT
<rdar://problem/35189327>
Comment 2 Ryosuke Niwa 2017-10-25 21:07:38 PDT
Created attachment 324950 [details]
Removes the superflous call to finishJSTest
Comment 3 Ryosuke Niwa 2017-10-25 21:09:41 PDT
Notice that the flakiness dashboard shows failures whenever the test took 3s.
Comment 4 Wenson Hsieh 2017-10-25 21:10:31 PDT
Comment on attachment 324950 [details]
Removes the superflous call to finishJSTest

rs=me
Comment 5 WebKit Commit Bot 2017-10-26 00:10:08 PDT
Comment on attachment 324950 [details]
Removes the superflous call to finishJSTest

Clearing flags on attachment: 324950

Committed r224010: <https://trac.webkit.org/changeset/224010>
Comment 6 WebKit Commit Bot 2017-10-26 00:10:10 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Alexey Proskuryakov 2017-10-26 09:32:38 PDT
This wasn't the root cause of the problem, as finishJSTest couldn't cause the unhandled promise rejection message.

+CONSOLE MESSAGE: line 30: Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'frame.contentDocument.body.innerHTML')

Removing the forced completion after 3 seconds has turned the test into a flaky timeout, hitting the same promise rejection on line 30.
Comment 8 Ryosuke Niwa 2017-10-26 12:16:26 PDT
(In reply to Alexey Proskuryakov from comment #7)
> This wasn't the root cause of the problem, as finishJSTest couldn't cause
> the unhandled promise rejection message.
> 
> +CONSOLE MESSAGE: line 30: Unhandled Promise Rejection: TypeError: null is
> not an object (evaluating 'frame.contentDocument.body.innerHTML')
> 
> Removing the forced completion after 3 seconds has turned the test into a
> flaky timeout, hitting the same promise rejection on line 30.

Oh, I missed that. We probably need to wait for the frame's content document to become available.
Comment 9 Ryosuke Niwa 2017-10-26 12:57:20 PDT
Created attachment 325044 [details]
Another fix
Comment 10 Ryosuke Niwa 2017-10-26 15:00:19 PDT
Committed r224052: <https://trac.webkit.org/changeset/224052>
Comment 11 Ryosuke Niwa 2017-10-27 01:39:41 PDT
Looks like the test stopped flaking!