[Webkit-unassigned] [Bug 256864] REGRESSION (2023-05-13): [ macOS ] TestWebKitAPI.WKAttachmentTests.MovePastedImageByDragging is a consistent failure

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 16 20:30:57 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=256864

--- Comment #4 from Wenson Hsieh <wenson_hsieh at apple.com> ---
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).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230517/ab393b66/attachment-0001.htm>


More information about the webkit-unassigned mailing list