Description: TestWebKitAPI.WKAttachmentTests.MovePastedImageByDragging The first failure I saw on the dashboard was on 5/13/2023 at 264047@main. History: https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.WKAttachmentTests.MovePastedImageByDragging Diff: Failed TestWebKitAPI.WKAttachmentTests.MovePastedImageByDragging 2023-05-16 13:52:01.742 TestWebKitAPI[40420:316648632] Expected to find ordered tags: ( STRONG, IMG ) in: ( IMG, DIV, STRONG, DIV, STRONG, BR ) /Volumes/Data/worker/Apple-Ventura-Release-Build/build/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:202 Expected equality of these values: [remainingTags count] Which is: 1 0U Which is: 0
<rdar://problem/109428176>
Looking at the flakiness dashboard, this seems to have started in the range https://commits.webkit.org/compare/264056@main...264046@main
This started failing on different revisions on different bots through Sunday. This fits neither code change nor environment change. I've rebooted bot135 just to see if this happens to change anything. Maybe drag and drop breaks after 45 days of uptime.
Robert Jenner let me borrow one of the test runners that's currently reproducing the test failure (bot211), and I was able to figure out where it's falling over. This API test is basically split into 2 parts: 1. It first copies and pastes an attachment-backed image in an editable webview. 2. It then starts an edit drag over (50, 50) (where the image is supposed to be), moving it within the view. The issue is that it's possible for the image to take long enough to load, that the test attempts to begin a drag over the image before it's even done loading/painting; this causes the drag (and API test) to fail. I confirmed that this adjustment fixes the race on bot211 (which is consistently hitting this failure otherwise): ``` diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm index 2197d4ff1983..a75522ce34ee 100644 --- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm +++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm @@ -1152,6 +1152,8 @@ TEST(WKAttachmentTests, MovePastedImageByDragging) platformCopyPNG(); [webView _synchronouslyExecuteEditCommand:@"Paste" argument:nil]; + [webView waitForImageElementSizeToBecome:CGSizeMake(215, 174)]; + [webView _executeEditCommand:@"InsertParagraph" argument:nil completion:nil]; [webView _executeEditCommand:@"InsertHTML" argument:@"<strong>text</strong>" completion:nil]; [webView _synchronouslyExecuteEditCommand:@"InsertParagraph" argument:nil]; ``` It's still somewhat of a mystery why this passed so consistently prior to 5/13, but it's also evident that the test is inherently racy, and may have flaked before then (just less frequently).
Pull request: https://github.com/WebKit/WebKit/pull/13948
And rebooting didn't help on bot135. This is quite a mystery.
Temperature in the lab hasn't changed, I checked.
Committed 264137@main (255d31d4f608): <https://commits.webkit.org/264137@main> Reviewed commits have been landed. Closing PR #13948 and removing active labels.