⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 266765 in webkit


Ignore:
Timestamp:
Sep 8, 2020, 5:52:53 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[ macOS iOS ] svg/animations/smil-leak-element-instances-noBaseValRef.svg is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=215353

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-09-08
Reviewed by Geoffrey Garen.

This patch reverts r265780 and goes in the opposite direction: allocating
lots and lots of objects, then proving that the number of live objects
did not grow a lot.

GCController can be conservative sometimes and leaves some objects here
and there. So we should not be checking that *all* the objects were freed
to verify there was no leak in allocating the SVG properties objects.

Instead we can check for an end-to-end test the memory did not grow a lot
despite the huge number of allocations.

  • svg/animations/smil-leak-element-instances-noBaseValRef.svg:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r266764 r266765  
     12020-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [ macOS iOS ] svg/animations/smil-leak-element-instances-noBaseValRef.svg is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=215353
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        This patch reverts r265780 and goes in the opposite direction: allocating
     9        lots and lots of objects, then proving that the number of live objects
     10        did not grow a lot.
     11
     12        GCController can be conservative sometimes and leaves some objects here
     13        and there. So we should not be checking that *all* the objects were freed
     14        to verify there was no leak in allocating the SVG properties objects.
     15
     16        Instead we can check for an end-to-end test the memory did not grow a lot
     17        despite the huge number of allocations.
     18
     19        * svg/animations/smil-leak-element-instances-noBaseValRef.svg:
     20
    1212020-09-08  Hector Lopez  <hector_i_lopez@apple.com>
    222
  • trunk/LayoutTests/svg/animations/smil-leak-element-instances-noBaseValRef.svg

    r265780 r266765  
    3333}
    3434
    35 function startTest() {
     35function runTest() {
    3636    // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
    3737    GCController.collect();
    38     originalLiveElements = window.internals.numberOfLiveNodes();
     38    var originalLiveElements = window.internals.numberOfLiveNodes();
    3939
    40     for (var i = 0; i < 3; i++)
     40    for (var i = 0; i < 1000; i++)
    4141        g.appendChild(createAnimatedRectInstance());
    4242
    43     setTimeout(continueTest, 0);
    44 }
    45 
    46 function continueTest() {
    4743    while (g.hasChildNodes())
    4844        g.removeChild(g.lastChild);
    4945
    50     setTimeout(finishTest, 0);
    51 }
     46    GCController.collect();
     47    var liveDelta = window.internals.numberOfLiveNodes() - originalLiveElements;
    5248
    53 var attemptsToFinish = 5;
    54 
    55 function finishTest() {
    56     GCController.collect();
    57 
    58     var liveDelta = window.internals.numberOfLiveNodes() - originalLiveElements;
    59     if (liveDelta == 0)
     49    // The goal of this test is to verify allocating lots and lots of objects will not
     50    // grow the allocated memory a lot once they are removed.
     51    if (liveDelta <= 5)
    6052        log("PASS");
    61     else if (--attemptsToFinish) {
    62         setTimeout(finishTest, 100);
    63         return;
    64     } else
     53    else
    6554        log("FAIL: " + liveDelta + " extra live node(s)");
    6655
     
    7766    }
    7867
    79     setTimeout(startTest, 0);
     68    setTimeout(runTest, 0);
    8069}
    8170]]>
Note: See TracChangeset for help on using the changeset viewer.