Bug 230047 - [ macOS and iOS ] editing/deleting/forward-delete-crash.html is timing out
Summary: [ macOS and iOS ] editing/deleting/forward-delete-crash.html is timing out
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: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-08 08:56 PDT by ayumi_kojima
Modified: 2021-12-13 12:20 PST (History)
9 users (show)

See Also:


Attachments
Patch (3.21 KB, patch)
2021-11-22 03:53 PST, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (3.27 KB, patch)
2021-12-03 08:52 PST, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (3.29 KB, patch)
2021-12-07 04:47 PST, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ayumi_kojima 2021-09-08 08:56:09 PDT
editing/deleting/forward-delete-crash.html

Is a flaky timeout (Almost consistent) on macOS and iOS simulator.

History: https://results.webkit.org/?suite=layout-tests&test=editing%2Fdeleting%2Fforward-delete-crash.html

Result page: https://build.webkit.org/results/Apple-BigSur-Debug-WK1-Tests/r282140%20(4040)/results.html

Diff:

--- /Volumes/Data/worker/bigsur-debug-tests-wk1/build/layout-test-results/editing/deleting/forward-delete-crash-expected.txt
+++ /Volumes/Data/worker/bigsur-debug-tests-wk1/build/layout-test-results/editing/deleting/forward-delete-crash-actual.txt
@@ -1 +1,5 @@
-Test passes if it does not crash.
+FAIL: Timed out waiting for notifyDone to be called
+:last-of-type { height: 1px; display: block; } @font-face { font-family: "Ahem"; src: url("../../resources/Ahem.ttf"); }
+if (window.testRunner) { window.testRunner.dumpAsText(); window.testRunner.waitUntilDone(); } onload = async () => { document.designMode = 'on'; let img0 = document.createElement('img'); img0.onerror = () => { document.execCommand('ForwardDelete'); setTimeout(function() { window.testRunner.notifyDone(); }, 0); document.write("Test passes if it does not crash."); }; let datalist0 = document.createElement('datalist'); document.head.appendChild(datalist0); document.head.appendChild(document.createElement('datalist')); img0.src = 'data:'; let embed0 = document.createElement('embed'); embed0.src = '#'; datalist0.appendChild(embed0); if (navigator.platform.indexOf('Mac') == 0 && window.caches) await caches.has('a'); else await document.fonts.load("80px Ahem"); img0.src = 'data:'; getSelection().selectAllChildren(datalist0); if (navigator.platform.indexOf('Mac') == 0 && window.caches) await caches.has('a'); else await document.fonts.load("80px Ahem"); document.execCommand('Delete'); };
+
+

Stderr:

2021-09-08 07:17:36.675 DumpRenderTree[64818:105897551] nil host used in call to allowsSpecificHTTPSCertificateForHost
2021-09-08 07:17:36.675 DumpRenderTree[64818:105897551] nil host used in call to allowsAnyHTTPSCertificateForHost:
2021-09-08 07:17:36.794 DumpRenderTree[64818:105897551] nil host used in call to allowsSpecificHTTPSCertificateForHost
2021-09-08 07:17:36.794 DumpRenderTree[64818:105897551] nil host used in call to allowsAnyHTTPSCertificateForHost:
2021-09-08 07:17:36.806 DumpRenderTree[64818:105897551] nil host used in call to allowsSpecificHTTPSCertificateForHost
2021-09-08 07:17:36.806 DumpRenderTree[64818:105897551] nil host used in call to allowsAnyHTTPSCertificateForHost:
Comment 1 Radar WebKit Bug Importer 2021-09-08 08:56:41 PDT
<rdar://problem/82875247>
Comment 2 ayumi_kojima 2021-09-08 08:57:26 PDT
Seems the test has been timing out since it was added at https://trac.webkit.org/changeset/282074/webkit
Comment 3 ayumi_kojima 2021-09-08 09:06:19 PDT
The test is also showing up on EWS as a pre-existing test. Marked expectations to speed up EWS https://trac.webkit.org/changeset/282145/webkit
Comment 4 Alexey Proskuryakov 2021-09-12 13:36:32 PDT
Why are we not reverting r282074, given that it included a broken test?
Comment 5 Ryosuke Niwa 2021-09-12 20:05:35 PDT
(In reply to Alexey Proskuryakov from comment #4)
> Why are we not reverting r282074, given that it included a broken test?

I don't think there is any issue with the fix. The issue is with the test.
Comment 6 Ryosuke Niwa 2021-09-12 20:06:30 PDT
(In reply to Ryosuke Niwa from comment #5)
> (In reply to Alexey Proskuryakov from comment #4)
> > Why are we not reverting r282074, given that it included a broken test?
> 
> I don't think there is any issue with the fix. The issue is with the test.

Also note that the test was passing on EWS.
Comment 7 Rob Buis 2021-09-15 10:47:03 PDT
This test is not enough to trigger the original problem anymore on ToT (with the original fix reverted). Still bisecting, but perhaps d0b3b4b3becae0da071719c86df2450e283e43bb changed timing/behaviour here.
Comment 8 Rob Buis 2021-09-15 13:54:12 PDT
(In reply to Rob Buis from comment #7)
> This test is not enough to trigger the original problem anymore on ToT (with
> the original fix reverted). Still bisecting, but perhaps
> d0b3b4b3becae0da071719c86df2450e283e43bb changed timing/behaviour here.

Indeed d0b3b4b3becae0da071719c86df2450e283e43bb is the one.
Comment 9 Rob Buis 2021-11-22 03:53:56 PST
Created attachment 444955 [details]
Patch
Comment 10 Rob Buis 2021-11-22 10:43:25 PST
(In reply to Rob Buis from comment #8)
> (In reply to Rob Buis from comment #7)
> > This test is not enough to trigger the original problem anymore on ToT (with
> > the original fix reverted). Still bisecting, but perhaps
> > d0b3b4b3becae0da071719c86df2450e283e43bb changed timing/behaviour here.
> 
> Indeed d0b3b4b3becae0da071719c86df2450e283e43bb is the one.

I should not have used the SHA, needed to bisect again, it is https://bugs.webkit.org/show_bug.cgi?id=229905 that changed behaviour so the test does not trigger the crash anymore.
Comment 11 Rob Buis 2021-12-03 08:52:54 PST
Created attachment 445861 [details]
Patch
Comment 12 Darin Adler 2021-12-03 10:09:27 PST
Comment on attachment 445861 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=445861&action=review

> LayoutTests/editing/deleting/forward-delete-crash.html:40
> +    setTimeout(function() { document.write("Test passes if it does not crash."); window.testRunner.notifyDone(); }, 10);

Seems like using a duration here adds a race to the test. While I won’t insist on it, is there a way to solve the problem without a race?
Comment 13 Rob Buis 2021-12-07 04:47:13 PST
Created attachment 446161 [details]
Patch
Comment 14 Rob Buis 2021-12-07 07:47:13 PST
Comment on attachment 445861 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=445861&action=review

>> LayoutTests/editing/deleting/forward-delete-crash.html:40
>> +    setTimeout(function() { document.write("Test passes if it does not crash."); window.testRunner.notifyDone(); }, 10);
> 
> Seems like using a duration here adds a race to the test. While I won’t insist on it, is there a way to solve the problem without a race?

I checked, indeed the 10ms wait is not needed.
Comment 15 EWS 2021-12-13 12:20:39 PST
Committed r286966 (245189@main): <https://commits.webkit.org/245189@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446161 [details].