<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>170177</bug_id>
          
          <creation_ts>2017-03-28 08:59:00 -0700</creation_ts>
          <short_desc>LayoutTest fast/images/reset-image-animation.html is a flaky failure</short_desc>
          <delta_ts>2023-04-27 17:42:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryan Haddad">ryanhaddad</reporter>
          <assigned_to name="Fujii Hironori">fujii</assigned_to>
          <cc>fujii</cc>
    
    <cc>graouts</cc>
    
    <cc>jonlee</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1291905</commentid>
    <comment_count>0</comment_count>
    <who name="Ryan Haddad">ryanhaddad</who>
    <bug_when>2017-03-28 08:59:00 -0700</bug_when>
    <thetext>LayoutTest fast/images/reset-image-animation.html is a flaky failure

https://build.webkit.org/results/Apple%20Sierra%20Debug%20WK2%20(Tests)/r214472%20(169)/results.html

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&amp;tests=fast%2Fimages%2Freset-image-animation.html

--- /Volumes/Data/slave/sierra-debug-tests-wk2/build/layout-test-results/fast/images/reset-image-animation-expected.txt
+++ /Volumes/Data/slave/sierra-debug-tests-wk2/build/layout-test-results/fast/images/reset-image-animation-actual.txt
@@ -4,7 +4,7 @@
 
 
 PASS internals.imageFrameIndex(image) is 0
-PASS internals.imageFrameIndex(image) is 1
+FAIL internals.imageFrameIndex(image) should be 1. Was 0.
 The animation of the image was reset.
 PASS internals.imageFrameIndex(image) is 0
 PASS internals.imageFrameIndex(image) is 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1292437</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-03-29 09:52:27 -0700</bug_when>
    <thetext>No clear regression point, but this has become much more frequent about a week ago.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1292539</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-03-29 13:20:28 -0700</bug_when>
    <thetext>Easily reproducible under CPU pressure:

run-webkit-tests -1 -v --no-build fast/images/reset-image-animation.html --repeat-each 1000 -f --child-processes=20</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1292654</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-03-29 17:35:26 -0700</bug_when>
    <thetext>r214450 had a fix to make the test not flaky, but it is still flaky.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294313</commentid>
    <comment_count>4</comment_count>
    <who name="Ryan Haddad">ryanhaddad</who>
    <bug_when>2017-04-04 18:00:27 -0700</bug_when>
    <thetext>Marked test as flaky in https://trac.webkit.org/r214921</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951478</commentid>
    <comment_count>5</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2023-04-26 17:46:50 -0700</bug_when>
    <thetext>WinCairo Debug is the most flaky bot.
https://results.webkit.org/?suite=layout-tests&amp;test=fast%2Fimages%2Freset-image-animation.html

The decoding frame seems to be delayed under heavy CPU load.
The following patch makes the test stable.

diff --git a/LayoutTests/fast/images/reset-image-animation.html b/LayoutTests/fast/images/reset-image-animation.html
index 62cb9bf09894..634a79b7be04 100644
--- a/LayoutTests/fast/images/reset-image-animation.html
+++ b/LayoutTests/fast/images/reset-image-animation.html
@@ -16,7 +16,7 @@
                 shouldBe(&quot;internals.imageFrameIndex(image)&quot;, expectedFrame.toString());
                 setTimeout(() =&gt; {
                     resolve(expectedFrame + 1);
-                }, 30);
+                }, 300);
             });
         }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951481</commentid>
    <comment_count>6</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2023-04-26 18:01:45 -0700</bug_when>
    <thetext>I tried another approach of retrying drawFrame until expected frame without extending the timer duration.
However, I&apos;m observing timeout failure for this approach.
Decoding frame doesn&apos;t proceed.
I have to extend the timer duration in this approach too.

diff --git a/LayoutTests/fast/images/reset-image-animation.html b/LayoutTests/fast/images/reset-image-animation.html
index 62cb9bf09894..8c6fdc75ac14 100644
--- a/LayoutTests/fast/images/reset-image-animation.html
+++ b/LayoutTests/fast/images/reset-image-animation.html
@@ -13,6 +13,8 @@
                 let canvas = document.getElementById(&quot;canvas&quot;);
                 let context = canvas.getContext(&quot;2d&quot;);
                 context.drawImage(image, 0, 0, canvas.width, canvas.height);
+                if (internals.imageFrameIndex(image) != expectedFrame)
+                    return drawFrame(expectedFrame).then(resolve);
                 shouldBe(&quot;internals.imageFrameIndex(image)&quot;, expectedFrame.toString());
                 setTimeout(() =&gt; {
                     resolve(expectedFrame + 1);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951482</commentid>
    <comment_count>7</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2023-04-26 18:13:44 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/13219</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951699</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-04-27 17:41:33 -0700</bug_when>
    <thetext>Committed 263478@main (b1cc64631025): &lt;https://commits.webkit.org/263478@main&gt;

Reviewed commits have been landed. Closing PR #13219 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951700</commentid>
    <comment_count>9</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-04-27 17:42:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/108636160&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>