Changeset 155648 in webkit


Ignore:
Timestamp:
Sep 12, 2013 2:02:39 PM (11 years ago)
Author:
ap@apple.com
Message:

svg/animations/smil-leak-*.svg tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=114280

Reviewed by Tim Horton.

Moved garbage collection out of the function that touches nodes to be collected,
making sure that they are definitely not on the stack.

I could not reproduce locally, so this is a speculative fix.

  • svg/animations/smil-leak-dynamically-added-element-instances.svg:
  • svg/animations/smil-leak-element-instances-noBaseValRef.svg:
  • svg/animations/smil-leak-element-instances.svg:
  • svg/animations/smil-leak-elements.svg:
Location:
trunk/LayoutTests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r155646 r155648  
     12013-09-12  Alexey Proskuryakov  <ap@apple.com>
     2
     3        svg/animations/smil-leak-*.svg tests are flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=114280
     5
     6        Reviewed by Tim Horton.
     7
     8        Moved garbage collection out of the function that touches nodes to be collected,
     9        making sure that they are definitely not on the stack.
     10
     11        I could not reproduce locally, so this is a speculative fix.
     12
     13        * svg/animations/smil-leak-dynamically-added-element-instances.svg:
     14        * svg/animations/smil-leak-element-instances-noBaseValRef.svg:
     15        * svg/animations/smil-leak-element-instances.svg:
     16        * svg/animations/smil-leak-elements.svg:
     17
    1182013-09-12  Alexey Proskuryakov  <ap@apple.com>
    219
  • trunk/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances.svg

    r124380 r155648  
    3333}
    3434
    35 function cleanup() {
     35function startTest() {
     36    // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
     37    GCController.collect();
     38    originalLiveElements = window.internals.numberOfLiveNodes();
     39
     40    for (var i = 0; i < 50; i++)
     41        g.appendChild(createAnimatedRectInstance());
     42
     43    setTimeout(addMoreInstances, 100);
     44}
     45
     46function addMoreInstances() {
     47    for (var i = 0; i < 50; i++)
     48        g.appendChild(createAnimatedRectInstance());
     49   
     50    setTimeout(continueTest, 0);
     51}
     52
     53function continueTest() {
    3654    while (g.hasChildNodes())
    3755        g.removeChild(g.lastChild);
    3856
     57    setTimeout(finishTest, 0);
     58}
     59
     60function finishTest() {
    3961    GCController.collect();
    4062
     
    4668
    4769    testRunner.notifyDone();
    48 }
    49 
    50 function addMoreInstances() {
    51     for (var i = 0; i < 50; i++)
    52         g.appendChild(createAnimatedRectInstance());
    53    
    54     setTimeout(cleanup, 0);
    55 }
    56 
    57 function startTest() {
    58     // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
    59     GCController.collect();
    60     originalLiveElements = window.internals.numberOfLiveNodes();
    61 
    62     for (var i = 0; i < 50; i++)
    63         g.appendChild(createAnimatedRectInstance());
    64 
    65     setTimeout(addMoreInstances, 100);
    6670}
    6771
  • trunk/LayoutTests/svg/animations/smil-leak-element-instances-noBaseValRef.svg

    r124380 r155648  
    3333}
    3434
    35 function cleanup() {
     35function startTest() {
     36    // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
     37    GCController.collect();
     38    originalLiveElements = window.internals.numberOfLiveNodes();
     39
     40    for (var i = 0; i < 100; i++)
     41        g.appendChild(createAnimatedRectInstance());
     42
     43    setTimeout(continueTest, 0);
     44}
     45
     46function continueTest() {
    3647    while (g.hasChildNodes())
    3748        g.removeChild(g.lastChild);
    3849
     50    setTimeout(finishTest, 0);
     51}
     52
     53function finishTest() {
    3954    GCController.collect();
    4055
     
    4661
    4762    testRunner.notifyDone();
    48 }
    49 
    50 function startTest() {
    51     // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
    52     GCController.collect();
    53     originalLiveElements = window.internals.numberOfLiveNodes();
    54 
    55     for (var i = 0; i < 100; i++)
    56         g.appendChild(createAnimatedRectInstance());
    57 
    58     setTimeout(cleanup, 0);
    5963}
    6064
  • trunk/LayoutTests/svg/animations/smil-leak-element-instances.svg

    r124380 r155648  
    3333}
    3434
    35 function cleanup() {
    36     while (g.hasChildNodes())
    37         g.removeChild(g.lastChild);
    38 
    39     GCController.collect();
    40 
    41     var liveDelta = window.internals.numberOfLiveNodes() - originalLiveElements;
    42     if (liveDelta == 0)
    43         log("PASS");
    44     else
    45         log("FAIL: " + liveDelta + " extra live node(s)");
    46 
    47     testRunner.notifyDone();
    48 }
    49 
    5035function startTest() {
    5136    // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
     
    5944        g.appendChild(createAnimatedRectInstance());
    6045
    61     setTimeout(cleanup, 0);
     46    setTimeout(continueTest, 0);
     47}
     48
     49function continueTest() {
     50    while (g.hasChildNodes())
     51        g.removeChild(g.lastChild);
     52
     53    setTimeout(finishTest, 0);
     54}
     55
     56function finishTest() {
     57    GCController.collect();
     58
     59    var liveDelta = window.internals.numberOfLiveNodes() - originalLiveElements;
     60    if (liveDelta == 0)
     61        log("PASS");
     62    else
     63        log("FAIL: " + liveDelta + " extra live node(s)");
     64
     65    testRunner.notifyDone();
    6266}
    6367
  • trunk/LayoutTests/svg/animations/smil-leak-elements.svg

    r124380 r155648  
    3131}
    3232
    33 function cleanup() {
     33function startTest() {
     34    // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
     35    GCController.collect();
     36    originalLiveElements = window.internals.numberOfLiveNodes();
     37
     38    for (var i = 0; i < 100; i++)
     39        g.appendChild(createAnimatedRect());
     40
     41    setTimeout(continueTest, 0);
     42}
     43
     44function continueTest() {
    3445    while (g.hasChildNodes())
    3546        g.removeChild(g.lastChild);
    3647
     48    setTimeout(finishTest, 0);
     49}
     50
     51function finishTest() {
    3752    GCController.collect();
    3853
     
    4459
    4560    testRunner.notifyDone();
    46 }
    47 
    48 function startTest() {
    49     // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
    50     GCController.collect();
    51     originalLiveElements = window.internals.numberOfLiveNodes();
    52 
    53     for (var i = 0; i < 100; i++)
    54         g.appendChild(createAnimatedRect());
    55 
    56     setTimeout(cleanup, 0);
    5761}
    5862
Note: See TracChangeset for help on using the changeset viewer.