Bug 258865

Summary: Attachment ref-tests should wait for the icon to be present
Product: WebKit Reporter: Gerald Squelart <g_squelart>
Component: HTML EditingAssignee: Gerald Squelart <g_squelart>
Status: RESOLVED FIXED    
Severity: Normal CC: rackler, ryanhaddad, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Gerald Squelart 2023-07-04 21:07:45 PDT
Attachment ref-tests don't add any delay before a snapshot is taken. However, attachments request their icon asynchronously during their first paint, meaning that if the snapshot is taken after this first paint it will probably not have the icon!
So I'm suspecting that ref-tests don't actually compare icons, and that intermittent failures could be due to the odd case when the icon is available unexpectedly fast.
To fix this, tests should delay the snapshot until all attachments have received their icon.
Comment 1 Radar WebKit Bug Importer 2023-07-04 21:07:57 PDT
<rdar://problem/111764330>
Comment 2 Gerald Squelart 2023-07-04 21:14:04 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15554
Comment 3 Ryan Haddad 2023-07-11 16:17:28 PDT
*** Bug 259127 has been marked as a duplicate of this bug. ***
Comment 4 Karl Rackler 2023-07-12 10:47:08 PDT
REGRESSION (265615@main): [ iOS macOS wk2 ] Four fast/attachment/cocoa/wide-attachment tests are flaky image failures

After landing 265615@main, some wide-attachment-* tests became flaky because of the way the icon is asynchronously fetched and then loaded into an img.

Description:
fast/attachment/cocoa/wide-attachment-folder-icon.html
fast/attachment/cocoa/wide-attachment-icon-from-file-extension.html
fast/attachment/mac/wide-attachment-title-with-rtl.html
fast/attachment/mac/wide-attachment-type-attribute.html

History:
https://results.webkit.org/?suite=layout-tests&suite=layout-tests&suite=layout-tests&suite=layout-tests&test=fast%2Fattachment%2Fcocoa%2Fwide-attachment-folder-icon.html&test=fast%2Fattachment%2Fcocoa%2Fwide-attachment-icon-from-file-extension.html&test=fast%2Fattachment%2Fmac%2Fwide-attachment-title-with-rtl.html&test=fast%2Fattachment%2Fmac%2Fwide-attachment-type-attribute.html&platform=mac

Since the resolution is being worked on in this bug, I have marked these tests as flaky image failures here while this issue is investigated.
Comment 5 EWS 2023-07-12 10:52:27 PDT
Test gardening commit 265994@main (b8b69392a0cc): <https://commits.webkit.org/265994@main>

Reviewed commits have been landed. Closing PR #15786 and removing active labels.
Comment 6 EWS 2023-07-12 12:14:24 PDT
Test gardening commit 265870.40@safari-7616-branch (a5090f836a89): <https://commits.webkit.org/265870.40@safari-7616-branch>

Reviewed commits have been landed. Closing PR #692 and removing active labels.
Comment 7 EWS 2023-07-18 15:53:01 PDT
Committed 266144@main (6e502e9d0156): <https://commits.webkit.org/266144@main>

Reviewed commits have been landed. Closing PR #15554 and removing active labels.