Title: [261058] trunk/LayoutTests
Revision
261058
Author
[email protected]
Date
2020-05-02 23:18:25 -0700 (Sat, 02 May 2020)

Log Message

editing/undo-manager/undo-manager-delete-stale-undo-items.html is timing out.
https://bugs.webkit.org/show_bug.cgi?id=211340
<rdar://problem/62767874>

Reviewed by Wenson Hsieh.

The test aims to measure the number of GC'ed Undo related objects.  It created
and estimated 600 objects and allows an error of 20 objects after GC is expected
to have collected these objects.  This turns out to be too tight an error allowance.
Just running any JS code could inadvertantly create more objects, that will exceed
that error allowance.

This patch attempts to make the test more robust by increasing the created object
count to an estimated 3000 objects and allows an error of 300 objects.  This means
we'll expect to see at least 2700 objects collected.  That is a high enough number
that it cannot be attributed to unexpected objects created by the JS runtime being
GCed.  The allowance of 300 is also much higher than number of unexpected objects
that the JS runtime may reasonably create beyond those managed by this test.

With this change, the test no longer times out.

* editing/undo-manager/undo-manager-delete-stale-undo-items-expected.txt:
* editing/undo-manager/undo-manager-delete-stale-undo-items.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261057 => 261058)


--- trunk/LayoutTests/ChangeLog	2020-05-03 03:53:40 UTC (rev 261057)
+++ trunk/LayoutTests/ChangeLog	2020-05-03 06:18:25 UTC (rev 261058)
@@ -1,3 +1,29 @@
+2020-05-02  Mark Lam  <[email protected]>
+
+        editing/undo-manager/undo-manager-delete-stale-undo-items.html is timing out.
+        https://bugs.webkit.org/show_bug.cgi?id=211340
+        <rdar://problem/62767874>
+
+        Reviewed by Wenson Hsieh.
+
+        The test aims to measure the number of GC'ed Undo related objects.  It created
+        and estimated 600 objects and allows an error of 20 objects after GC is expected
+        to have collected these objects.  This turns out to be too tight an error allowance.
+        Just running any JS code could inadvertantly create more objects, that will exceed
+        that error allowance.
+
+        This patch attempts to make the test more robust by increasing the created object
+        count to an estimated 3000 objects and allows an error of 300 objects.  This means
+        we'll expect to see at least 2700 objects collected.  That is a high enough number
+        that it cannot be attributed to unexpected objects created by the JS runtime being
+        GCed.  The allowance of 300 is also much higher than number of unexpected objects
+        that the JS runtime may reasonably create beyond those managed by this test.
+
+        With this change, the test no longer times out.
+
+        * editing/undo-manager/undo-manager-delete-stale-undo-items-expected.txt:
+        * editing/undo-manager/undo-manager-delete-stale-undo-items.html:
+
 2020-05-02  Simon Fraser  <[email protected]>
 
         Make it possible to test overlay scrollbar interactions

Modified: trunk/LayoutTests/editing/undo-manager/undo-manager-delete-stale-undo-items-expected.txt (261057 => 261058)


--- trunk/LayoutTests/editing/undo-manager/undo-manager-delete-stale-undo-items-expected.txt	2020-05-03 03:53:40 UTC (rev 261057)
+++ trunk/LayoutTests/editing/undo-manager/undo-manager-delete-stale-undo-items-expected.txt	2020-05-03 06:18:25 UTC (rev 261058)
@@ -3,7 +3,7 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-PASS objectCountBeforeClearingUndoStack - objectCountAfterClearingUndoStack is >= 580
+PASS objectCountBeforeClearingUndoStack - objectCountAfterClearingUndoStack is >= 2700
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/editing/undo-manager/undo-manager-delete-stale-undo-items.html (261057 => 261058)


--- trunk/LayoutTests/editing/undo-manager/undo-manager-delete-stale-undo-items.html	2020-05-03 03:53:40 UTC (rev 261057)
+++ trunk/LayoutTests/editing/undo-manager/undo-manager-delete-stale-undo-items.html	2020-05-03 06:18:25 UTC (rev 261058)
@@ -23,7 +23,7 @@
             editor = document.getElementById("editor");
             editor.focus();
 
-            const undoItemCount = 200;
+            const undoItemCount = 1000;
 
             for (let i = 0; i < undoItemCount; ++i) {
                 document.undoManager.addItem(new UndoItem({
@@ -46,7 +46,7 @@
             // some wiggle room for additional wrappers created when calling some testing helper functions. This is
             // still a useful test, since it will time out in the case where either our undo items or their undo/redo
             // handlers are not properly relinquished once they're no longer needed.
-            const minimumNumberOfWrappersToCollectBeforePassing = 3 * undoItemCount - 20;
+            const minimumNumberOfWrappersToCollectBeforePassing = 3 * undoItemCount - 300;
             objectCountAfterClearingUndoStack = objectCountBeforeClearingUndoStack;
             while (objectCountBeforeClearingUndoStack - objectCountAfterClearingUndoStack < minimumNumberOfWrappersToCollectBeforePassing) {
                 await new Promise(resolve => setTimeout(resolve, 100));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to