RESOLVED FIXED 185965
[iOS] TestWebKitAPI.PasteImage tests are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=185965
Summary [iOS] TestWebKitAPI.PasteImage tests are flaky failures
Ryan Haddad
Reported 2018-05-24 16:31:04 PDT
The following API test is a flaky failure on iOS Simulator bots: TestWebKitAPI.PasteImage.PastePNGImage /Volumes/Data/slave/ios-simulator-11-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:115 Value of: [webView stringByEvaluatingJavaScript:@"imageElement.width"] Actual: "0" Expected: "200" https://build.webkit.org/builders/Apple%20iOS%2011%20Simulator%20Release%20WK2%20(Tests)/builds/5205/steps/run-api-tests/logs/stdio
Attachments
Patch (2.94 KB, patch)
2018-08-29 20:47 PDT, Wenson Hsieh
no flags
Patch (4.33 KB, patch)
2018-08-30 14:08 PDT, Wenson Hsieh
no flags
Ryan Haddad
Comment 1 2018-05-24 17:30:27 PDT
I see a similar failure with TestWebKitAPI.PasteImage.PasteGIFImage @ r231863 /Volumes/Data/slave/ios-simulator-11-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:71 Value of: [webView stringByEvaluatingJavaScript:@"imageElement.width"] Actual: "0" Expected: "400" https://build.webkit.org/builders/Apple%20iOS%2011%20Simulator%20Release%20WK2%20%28Tests%29/builds/5029
Ryan Haddad
Comment 3 2018-07-02 10:08:35 PDT
I can easily reproduce these failures by running the tests in a loop: while true; do run-api-tests --ios-simulator PasteImage; done
Radar WebKit Bug Importer
Comment 4 2018-07-02 10:08:47 PDT
Radar WebKit Bug Importer
Comment 5 2018-07-02 10:09:02 PDT
Wenson Hsieh
Comment 6 2018-07-02 10:10:29 PDT
I suspect we just need to wait for the image elements to become their expected sizes.
Ryan Haddad
Comment 7 2018-08-29 11:47:24 PDT
(In reply to Wenson Hsieh from comment #6) > I suspect we just need to wait for the image elements to become their > expected sizes. Is this a quick fix? These failures are frequently making the bots red.
Wenson Hsieh
Comment 8 2018-08-29 12:44:32 PDT
(In reply to Ryan Haddad from comment #7) > (In reply to Wenson Hsieh from comment #6) > > I suspect we just need to wait for the image elements to become their > > expected sizes. > Is this a quick fix? These failures are frequently making the bots red. If my speculation is correct, the fix should be trivial. I'll take a look at this by the end of the week and see (we may just need to sprinkle `[webView waitForMessage:@"loaded"];` in some places).
Wenson Hsieh
Comment 9 2018-08-29 20:47:58 PDT
WebKit Commit Bot
Comment 10 2018-08-30 07:35:35 PDT
Comment on attachment 348478 [details] Patch Clearing flags on attachment: 348478 Committed r235504: <https://trac.webkit.org/changeset/235504>
WebKit Commit Bot
Comment 11 2018-08-30 07:35:37 PDT
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 12 2018-08-30 13:14:59 PDT
Truitt Savell
Comment 13 2018-08-30 13:20:22 PDT
(In reply to Ryan Haddad from comment #12) > It looks like these tests time out on macOS now :( > > TestWebKitAPI.PasteImage.PastePNGImage > https://build.webkit.org/builders/Apple%20Sierra%20Debug%20WK2%20(Tests)/ > builds/7823/steps/run-api-tests/logs/stdio > > TestWebKitAPI.PasteImage.PasteGIFImage > https://build.webkit.org/builders/Apple%20Sierra%20Debug%20WK1%20%28Tests%29/ > builds/9324/steps/run-api-tests/logs/stdio Also TestWebKitAPI.PasteImage.PasteJPEGImage https://build.webkit.org/builders/Apple%20Sierra%20Debug%20WK1%20%28Tests%29/builds/9326/steps/run-api-tests/logs/stdio
Wenson Hsieh
Comment 14 2018-08-30 13:22:41 PDT
(In reply to Ryan Haddad from comment #12) > It looks like these tests time out on macOS now :( > > TestWebKitAPI.PasteImage.PastePNGImage > https://build.webkit.org/builders/Apple%20Sierra%20Debug%20WK2%20(Tests)/ > builds/7823/steps/run-api-tests/logs/stdio > > TestWebKitAPI.PasteImage.PasteGIFImage > https://build.webkit.org/builders/Apple%20Sierra%20Debug%20WK1%20%28Tests%29/ > builds/9324/steps/run-api-tests/logs/stdio Weird! I'll look into this later today. I suppose it's possible that images can load /too/ quickly on macOS, and we dispatch the "load" event before the UI process even gets a chance to register a message handler. I can test this by registering prior to calling insertFileAsImage.
Wenson Hsieh
Comment 15 2018-08-30 14:08:51 PDT
Reopening to attach new patch.
Wenson Hsieh
Comment 16 2018-08-30 14:08:51 PDT
Wenson Hsieh
Comment 17 2018-08-30 14:11:21 PDT
(In reply to Wenson Hsieh from comment #16) > Created attachment 348545 [details] > Patch Luckily, I'm able to reproduce the timeouts on macOS this time. This should fix the timeouts that started after my previous attempt...
WebKit Commit Bot
Comment 18 2018-08-30 15:50:43 PDT
Comment on attachment 348545 [details] Patch Clearing flags on attachment: 348545 Committed r235528: <https://trac.webkit.org/changeset/235528>
WebKit Commit Bot
Comment 19 2018-08-30 15:50:45 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.