<?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>177834</bug_id>
          
          <creation_ts>2017-10-03 13:20:06 -0700</creation_ts>
          <short_desc>Layout Test http/tests/inspector/network/beacon-type.html is flaky.</short_desc>
          <delta_ts>2017-10-03 14:11:56 -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>Web Inspector</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="Matt Lewis">jlewis3</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1356002</commentid>
    <comment_count>0</comment_count>
    <who name="Matt Lewis">jlewis3</who>
    <bug_when>2017-10-03 13:20:06 -0700</bug_when>
    <thetext>http/tests/inspector/network/beacon-type.html is a flaky timeout on Sierra and High Sierra WK2 according to the dashboard.

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&amp;tests=http%2Ftests%2Finspector%2Fnetwork%2Fbeacon-type.html

It looks like the flaky timeout started with this build:
https://build.webkit.org/results/Apple%20High%20Sierra%20Release%20WK2%20(Tests)/r222740%20(113)/results.html
https://build.webkit.org/builders/Apple%20High%20Sierra%20Release%20WK2%20(Tests)/builds/113

and this revision:
https://trac.webkit.org/changeset/222739/webkit

Diff:
--- /Volumes/Data/slave/sierra-release-tests-wk2/build/layout-test-results/http/tests/inspector/network/beacon-type-expected.txt
+++ /Volumes/Data/slave/sierra-release-tests-wk2/build/layout-test-results/http/tests/inspector/network/beacon-type-actual.txt
@@ -1,22 +1,5 @@
-Tests for Resource.Type.Beacon.
+#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 28326)
+FAIL: Timed out waiting for notifyDone to be called
 
-
-== Running test suite: Resource.Type.Beacon
--- Running test case: Resource.Type.Beacon.204
-PASS: Resource should be Beacon type.
-PASS: Resource should be a POST request.
-PASS: Resource should have a 204 response.
-PASS: Resource should not have request data.
-
--- Running test case: Resource.Type.Beacon.404
-PASS: Resource should be Beacon type.
-PASS: Resource should be a POST request.
-PASS: Resource should have a 404 response.
-PASS: Resource should not have request data.
-
--- Running test case: Resource.Type.Beacon.WithData
-PASS: Resource should be Beacon type.
-PASS: Resource should be a POST request.
-PASS: Resource should have a 200 response.
-PASS: Resource should have &apos;SENDING-DATA&apos; request data.
-
+#EOF
+#EOF


current build:
https://build.webkit.org/results/Apple%20Sierra%20Release%20WK2%20(Tests)/r222788%20(4724)/results.html
https://build.webkit.org/builders/Apple%20Sierra%20Release%20WK2%20(Tests)/builds/4724</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1356010</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-10-03 13:37:09 -0700</bug_when>
    <thetext>Added debug logging with:
https://trac.webkit.org/changeset/222805/webkit

That will hopefully get me actionable data about why this test is timing out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1356017</commentid>
    <comment_count>2</comment_count>
    <who name="Matt Lewis">jlewis3</who>
    <bug_when>2017-10-03 13:49:33 -0700</bug_when>
    <thetext>event: {&quot;method&quot;:&quot;Network.requestWillBeSent&quot;,&quot;params&quot;:{&quot;requestId&quot;:&quot;0.23&quot;,&quot;frameId&quot;:&quot;0.1&quot;,&quot;loaderId&quot;:&quot;0.6&quot;,&quot;documentURL&quot;:&quot;http://127.0.0.1:8000/inspector/network/beacon-type.html&quot;,
&quot;request&quot;:{&quot;url&quot;:&quot;http://127.0.0.1:8000/inspector/network/resources/beacon.php?status=204&quot;,&quot;method&quot;:&quot;POST&quot;,&quot;headers&quot;:{&quot;Referer&quot;:&quot;http://127.0.0.1:8000/inspector/network/beacon-type.html&quot;,&quot;User-Agent&quot;:&quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13) AppleWebKit/605.1.9 (KHTML, like Gecko)&quot;,&quot;Origin&quot;:&quot;http://127.0.0.1:8000&quot;,&quot;Accept&quot;:&quot;*/*&quot;,&quot;Cache-Control&quot;:&quot;max-age=0&quot;}},&quot;timestamp&quot;:0.015034461997856852,&quot;initiator&quot;:{&quot;type&quot;:&quot;script&quot;,&quot;stackTrace&quot;:[{&quot;functionName&quot;:&quot;sendBeacon&quot;,&quot;url&quot;:&quot;[native code]&quot;,&quot;scriptId&quot;:&quot;0&quot;,&quot;lineNumber&quot;:0,&quot;columnNumber&quot;:0},{&quot;functionName&quot;:&quot;triggerBeaconWith204Response&quot;,&quot;url&quot;:&quot;http://127.0.0.1:8000/inspector/network/beacon-type.html&quot;,&quot;scriptId&quot;:&quot;113&quot;,&quot;lineNumber&quot;:8,&quot;columnNumber&quot;:25},{&quot;functionName&quot;:&quot;global code&quot;,&quot;url&quot;:&quot;&quot;,&quot;scriptId&quot;:&quot;121&quot;,&quot;lineNumber&quot;:1,&quot;columnNumber&quot;:29},{&quot;functionName&quot;:&quot;evaluateWithScopeExtension&quot;,&quot;url&quot;:&quot;[native code]&quot;,&quot;scriptId&quot;:&quot;0&quot;,&quot;lineNumber&quot;:0,&quot;columnNumber&quot;:0},{&quot;functionName&quot;:&quot;_evaluateOn&quot;,&quot;url&quot;:&quot;&quot;,&quot;scriptId&quot;:&quot;117&quot;,&quot;lineNumber&quot;:128,&quot;columnNumber&quot;:29},{&quot;functionName&quot;:&quot;_evaluateAndWrap&quot;,&quot;url&quot;:&quot;&quot;,&quot;scriptId&quot;:&quot;117&quot;,&quot;lineNumber&quot;:122,&quot;columnNumber&quot;:108}]},&quot;type&quot;:&quot;Beacon&quot;}}
response: {&quot;result&quot;:{&quot;result&quot;:{&quot;type&quot;:&quot;undefined&quot;},&quot;wasThrown&quot;:false},&quot;id&quot;:27}
event: {&quot;method&quot;:&quot;Network.responseReceived&quot;,&quot;params&quot;:{&quot;requestId&quot;:&quot;0.23&quot;,&quot;frameId&quot;:&quot;0.1&quot;,&quot;loaderId&quot;:&quot;0.6&quot;,&quot;timestamp&quot;:0.017259075997571927,&quot;type&quot;:&quot;Beacon&quot;,&quot;response&quot;:{&quot;url&quot;:&quot;http://127.0.0.1:8000/inspector/network/resources/beacon.php?status=204&quot;,&quot;status&quot;:204,&quot;statusText&quot;:&quot;No Content&quot;,&quot;headers&quot;:{&quot;Content-Type&quot;:&quot;text/html&quot;,&quot;Keep-Alive&quot;:&quot;timeout=15, max=86&quot;,&quot;Date&quot;:&quot;Tue, 03 Oct 2017 20:43:45 GMT&quot;,&quot;Connection&quot;:&quot;Keep-Alive&quot;,&quot;X-Powered-By&quot;:&quot;PHP/7.1.7&quot;,&quot;Server&quot;:&quot;Apache/2.4.27 (Unix) PHP/7.1.7 LibreSSL/2.2.7&quot;},&quot;mimeType&quot;:&quot;text/html&quot;,&quot;source&quot;:&quot;unknown&quot;}}}
event: {&quot;method&quot;:&quot;Network.loadingFinished&quot;,&quot;params&quot;:{&quot;requestId&quot;:&quot;0.23&quot;,&quot;timestamp&quot;:0.0172940810007276,&quot;metrics&quot;:{}}}
PASS: Resource should be Beacon type.
request: {&quot;id&quot;:28,&quot;method&quot;:&quot;Runtime.evaluate&quot;,&quot;params&quot;:{&quot;expression&quot;:&quot;TestPage.addResult(unescape(\&quot;PASS%3A%20Resource%20should%20be%20Beacon%20type.\&quot;))&quot;,&quot;objectGroup&quot;:&quot;test&quot;,&quot;includeCommandLineAPI&quot;:false}}
PASS: Resource should be a POST request.
request: {&quot;id&quot;:29,&quot;method&quot;:&quot;Runtime.evaluate&quot;,&quot;params&quot;:{&quot;expression&quot;:&quot;TestPage.addResult(unescape(\&quot;PASS%3A%20Resource%20should%20be%20a%20POST%20request.\&quot;))&quot;,&quot;objectGroup&quot;:&quot;test&quot;,&quot;includeCommandLineAPI&quot;:false}}
event: {&quot;method&quot;:&quot;Debugger.scriptParsed&quot;,&quot;params&quot;:{&quot;scriptId&quot;:&quot;122&quot;,&quot;url&quot;:&quot;&quot;,&quot;startLine&quot;:0,&quot;startColumn&quot;:0,&quot;endLine&quot;:0,&quot;endColumn&quot;:81}}
response: {&quot;result&quot;:{&quot;result&quot;:{&quot;type&quot;:&quot;undefined&quot;},&quot;wasThrown&quot;:false},&quot;id&quot;:28}
event: {&quot;method&quot;:&quot;Debugger.scriptParsed&quot;,&quot;params&quot;:{&quot;scriptId&quot;:&quot;123&quot;,&quot;url&quot;:&quot;&quot;,&quot;startLine&quot;:0,&quot;startColumn&quot;:0,&quot;endLine&quot;:0,&quot;endColumn&quot;:86}}
response: {&quot;result&quot;:{&quot;result&quot;:{&quot;type&quot;:&quot;undefined&quot;},&quot;wasThrown&quot;:false},&quot;id&quot;:29}
Wait on notifyDone timed out, process com.apple.WebKit.WebContent.Development pid = 12965#EOF</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1356033</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-10-03 14:10:00 -0700</bug_when>
    <thetext>&gt; {&quot;method&quot;:&quot;Network.loadingFinished&quot;,&quot;params&quot;:{&quot;requestId&quot;:&quot;0.23&quot;,&quot;timestamp&quot;: 0.0172940810007276,&quot;metrics&quot;:{}}}
&gt; PASS: Resource should be Beacon type.

This is the key. The loadingFinished event was received and processed before the Test&apos;s Promise microtask runs. So this promise ends up waiting on events for the resource load to complete but it has already completed. We can skip the wait on events if the resource load finished.

I was able to reproduce ~1 in 250 runs on my laptop.
After fix I wasn&apos;t able to reproduce. Going to land the tiny test change unreviewed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1356034</commentid>
    <comment_count>4</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2017-10-03 14:10:52 -0700</bug_when>
    <thetext>&lt;https://trac.webkit.org/changeset/222808/webkit&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1356035</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-10-03 14:11:56 -0700</bug_when>
    <thetext>&lt;rdar://problem/34798863&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>