<?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>50581</bug_id>
          
          <creation_ts>2010-12-06 12:21:18 -0800</creation_ts>
          <short_desc>Make TestResultsServer return empty JSON or 404 for non-existing results files</short_desc>
          <delta_ts>2010-12-06 16:07:22 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kinuko Yasuda">kinuko</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ojan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>317780</commentid>
    <comment_count>0</comment_count>
    <who name="Kinuko Yasuda">kinuko</who>
    <bug_when>2010-12-06 12:21:18 -0800</bug_when>
    <thetext>Make TestResultsServer return empty JSON or 404 for non-existing results files.

For non-layout tests some builders do not have complete test results but only for a specific set of tests (e.g. only ui_tests and net_unittests for &quot;XP Tests (dbg)(2)&quot; builder etc).
We should return empty json or 404 for such cases (otherwise the dashboard frontend won&apos;t run as intended).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317786</commentid>
    <comment_count>1</comment_count>
      <attachid>75726</attachid>
    <who name="Kinuko Yasuda">kinuko</who>
    <bug_when>2010-12-06 12:23:33 -0800</bug_when>
    <thetext>Created attachment 75726
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317793</commentid>
    <comment_count>2</comment_count>
      <attachid>75726</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-12-06 12:32:44 -0800</bug_when>
    <thetext>Comment on attachment 75726
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=75726&amp;action=review

&gt; WebKitTools/TestResultServer/handlers/testfilehandler.py:118
&gt; +            return EMPTY_JSON_FORMAT % builder

Why do we want to do this instead of handling None at the calling location? Don&apos;t we want to 404 in this case as well?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317802</commentid>
    <comment_count>3</comment_count>
      <attachid>75726</attachid>
    <who name="Kinuko Yasuda">kinuko</who>
    <bug_when>2010-12-06 12:42:58 -0800</bug_when>
    <thetext>Comment on attachment 75726
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=75726&amp;action=review

&gt;&gt; WebKitTools/TestResultServer/handlers/testfilehandler.py:118
&gt;&gt; +            return EMPTY_JSON_FORMAT % builder
&gt; 
&gt; Why do we want to do this instead of handling None at the calling location? Don&apos;t we want to 404 in this case as well?

I want to do so as well, simply returning 404 somehow didn&apos;t get the script.onerror function called in my local env (unlike normal 404 error).  I haven&apos;t investigated it yet -- do you know how to make it work?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317805</commentid>
    <comment_count>4</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-12-06 12:46:52 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; I want to do so as well, simply returning 404 somehow didn&apos;t get the script.onerror function called in my local env (unlike normal 404 error).  I haven&apos;t investigated it yet -- do you know how to make it work?

Hm...should work. Maybe it&apos;s some issue with serving off localhost. Maybe try updating the testing server and see if it works there? 

http://test-results-test.appspot.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317809</commentid>
    <comment_count>5</comment_count>
    <who name="Kinuko Yasuda">kinuko</who>
    <bug_when>2010-12-06 13:01:33 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; I want to do so as well, simply returning 404 somehow didn&apos;t get the script.onerror function called in my local env (unlike normal 404 error).  I haven&apos;t investigated it yet -- do you know how to make it work?
&gt; 
&gt; Hm...should work. Maybe it&apos;s some issue with serving off localhost. Maybe try updating the testing server and see if it works there? 
&gt; 
&gt; http://test-results-test.appspot.com/

I updated the test-results-test server but getting the same result.
(The console shows &apos;Failed to load resource: the server responded with a status of 404 (Not Found)&apos; error messages as well as for normal 404 but the error function isn&apos;t being hooked up.)

Will you be able to take a look at it?  On the testing server now URLs like following returns 404.
http://test-results-test.appspot.com/testfile?builder=Linux%20Builder%20(Views%20dbg)&amp;master=Chromium&amp;testtype=unit_tests&amp;name=results.json</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317837</commentid>
    <comment_count>6</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-12-06 14:05:47 -0800</bug_when>
    <thetext>Looks like a webkit bug. At first glance, it seems we don&apos;t fire the error event for a 404 if the file contents are empty. Firefox fires the error event in this case. As a workaround, on the JS side, we can listen to the load event as well and check if the script is empty, e.g., 

&lt;script
  id=&quot;foo&quot; 
  src=&quot;http://test-results-test.appspot.com/testfile?builder=Linux%20Builder%20(Views%20dbg)&amp;master=Chromium&amp;testtype=unit_tests&amp;name=results.json&quot;
  onload=&quot;alert(&apos;innerHTML=\&apos;&apos; + document.getElementById(&apos;foo&apos;).innerHTML + &apos;\&apos;&apos;);&quot;
  onerror=&quot;alert(&apos;error&apos;)&quot;&gt;&lt;/script&gt;

Eventually, we can fix the webkit bug and won&apos;t need this anymore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317845</commentid>
    <comment_count>7</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-12-06 14:22:31 -0800</bug_when>
    <thetext>Bug 50589 for the onerror bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317882</commentid>
    <comment_count>8</comment_count>
      <attachid>75742</attachid>
    <who name="Kinuko Yasuda">kinuko</who>
    <bug_when>2010-12-06 15:38:26 -0800</bug_when>
    <thetext>Created attachment 75742
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317884</commentid>
    <comment_count>9</comment_count>
    <who name="Kinuko Yasuda">kinuko</who>
    <bug_when>2010-12-06 15:42:54 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Looks like a webkit bug. At first glance, it seems we don&apos;t fire the error event for a 404 if the file contents are empty. Firefox fires the error event in this case. As a workaround, on the JS side, we can listen to the load event as well and check if the script is empty, e.g., 
&gt; 
&gt; &lt;script
&gt;   id=&quot;foo&quot; 
&gt;   src=&quot;http://test-results-test.appspot.com/testfile?builder=Linux%20Builder%20(Views%20dbg)&amp;master=Chromium&amp;testtype=unit_tests&amp;name=results.json&quot;
&gt;   onload=&quot;alert(&apos;innerHTML=\&apos;&apos; + document.getElementById(&apos;foo&apos;).innerHTML + &apos;\&apos;&apos;);&quot;
&gt;   onerror=&quot;alert(&apos;error&apos;)&quot;&gt;&lt;/script&gt;
&gt; 
&gt; Eventually, we can fix the webkit bug and won&apos;t need this anymore.

Interesting.  onload work-around seemed to work.
I updated the patch just to return 404.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>317900</commentid>
    <comment_count>10</comment_count>
    <who name="Kinuko Yasuda">kinuko</who>
    <bug_when>2010-12-06 16:07:22 -0800</bug_when>
    <thetext>Committed r73409: &lt;http://trac.webkit.org/changeset/73409&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>75726</attachid>
            <date>2010-12-06 12:23:33 -0800</date>
            <delta_ts>2010-12-06 15:38:24 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-50581-20101206122332.patch</filename>
            <type>text/plain</type>
            <size>1923</size>
            <attacher name="Kinuko Yasuda">kin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Wxlc1swXS5kYXRhCiAKQEAgLTE1OCw3
ICsxNjAsOCBAQCBjbGFzcyBHZXRGaWxlKHdlYmFwcC5SZXF1ZXN0SGFuZGxlcik6CiAgICAgICAg
IGlmIGpzb246CiAgICAgICAgICAgICBzZWxmLnJlc3BvbnNlLmhlYWRlcnNbIkNvbnRlbnQtVHlw
ZSJdID0gInRleHQvcGxhaW47IGNoYXJzZXQ9dXRmLTgiCiAgICAgICAgICAgICBzZWxmLnJlc3Bv
bnNlLm91dC53cml0ZShqc29uKQotCisgICAgICAgIGVsc2U6CisgICAgICAgICAgICBzZWxmLmVy
cm9yKDQwNCkKIAogY2xhc3MgVXBsb2FkKHdlYmFwcC5SZXF1ZXN0SGFuZGxlcik6CiAgICAgIiIi
VXBsb2FkIHRlc3QgcmVzdWx0cyBmaWxlIHRvIGRhdGFzdG9yZS4iIiIK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>75742</attachid>
            <date>2010-12-06 15:38:26 -0800</date>
            <delta_ts>2010-12-06 15:40:19 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-50581-20101206153825.patch</filename>
            <type>text/plain</type>
            <size>1278</size>
            <attacher name="Kinuko Yasuda">kinuko</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdFRvb2xzL0NoYW5nZUxvZyBiL1dlYktpdFRvb2xzL0NoYW5nZUxv
ZwppbmRleCBmOTc3OGU1NWRlNjU1MTI3Y2FiOGQ3MTgyYTcyZmQ2MzFkZDFmYzQ1Li42YWNiNzU4
NDMwMWQxODBlZWRiMWE3OTJmYTc0MThjNzJmODdhY2UwIDEwMDY0NAotLS0gYS9XZWJLaXRUb29s
cy9DaGFuZ2VMb2cKKysrIGIvV2ViS2l0VG9vbHMvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTIgQEAK
KzIwMTAtMTItMDYgIEtpbnVrbyBZYXN1ZGEgIDxraW51a29AY2hyb21pdW0ub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vbnRlbnQtVHlwZSJdID0gInRleHQvcGxhaW47
IGNoYXJzZXQ9dXRmLTgiCiAgICAgICAgICAgICBzZWxmLnJlc3BvbnNlLm91dC53cml0ZShqc29u
KQotCisgICAgICAgIGVsc2U6CisgICAgICAgICAgICBzZWxmLmVycm9yKDQwNCkKIAogY2xhc3Mg
VXBsb2FkKHdlYmFwcC5SZXF1ZXN0SGFuZGxlcik6CiAgICAgIiIiVXBsb2FkIHRlc3QgcmVzdWx0
cyBmaWxlIHRvIGRhdGFzdG9yZS4iIiIK
</data>
<flag name="review"
          id="66570"
          type_id="1"
          status="+"
          setter="ojan"
    />
          </attachment>
      

    </bug>

</bugzilla>