<?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>151262</bug_id>
          
          <creation_ts>2015-11-13 08:56:02 -0800</creation_ts>
          <short_desc>WebKit should not need to modify testharness.js</short_desc>
          <delta_ts>2015-11-16 10:25:17 -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>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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>150332</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="youenn fablet">youennf</reporter>
          <assigned_to name="youenn fablet">youennf</assigned_to>
          <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>lforschler</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1141836</commentid>
    <comment_count>0</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-13 08:56:02 -0800</bug_when>
    <thetext>Currently WebKit has its own version of testharness.js.
The modification is related to timeout values.
It may just be better to disable testharness timeout in testharnessreport.js
This will simplify further updates of testharness.js</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141837</commentid>
    <comment_count>1</comment_count>
      <attachid>265481</attachid>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-13 08:58:13 -0800</bug_when>
    <thetext>Created attachment 265481
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141840</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-11-13 09:17:01 -0800</bug_when>
    <thetext>I&apos;m not sure if we can expect that the default timeout will suffice for us. I believe that the tests are designed to work sequentially, but we run them in parallel, which can cause almost 10x slowdown.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141846</commentid>
    <comment_count>3</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-13 09:28:26 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; I&apos;m not sure if we can expect that the default timeout will suffice for us.
&gt; I believe that the tests are designed to work sequentially, but we run them
&gt; in parallel, which can cause almost 10x slowdown.

AFAICT, there are two testharness timeouts, one for each subtest and one for each file.
The values modified in testharness.js only apply to the global timeout.
explicit_timeout=true disables the global timeout, so this should be fine to reset those value to their default.

As of the subtest timeout, by default, none is set.
This is done by the author, writing something  like
async_test(&quot;title&quot;, {timeout: 1000}).

If we want to increase these values compared to what is done currently, we can use timeout_multiplier in testharnessreport.js.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141849</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-11-13 09:33:09 -0800</bug_when>
    <thetext>&gt; AFAICT, there are two testharness timeouts, one for each subtest and one for each file.

Right, what I&apos;m saying is that per-file timeouts are likely wrong for our environment.

&gt; If we want to increase these values compared to what is done currently, we can use timeout_multiplier in testharnessreport.js.

That may be OK, especially if that means that per-file timeouts are also increased.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141850</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-13 09:41:41 -0800</bug_when>
    <thetext>&gt; That may be OK, especially if that means that per-file timeouts are also
&gt; increased.

timeout_multiplier only applies to per-test timeout.
This is ok since this patch disables per-file timeout by setting &quot;explicit_timeout&quot; to true.

Doing a quick grep, it seems that a little bit more than 100 tests do set per-test timeouts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141857</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-11-13 09:59:35 -0800</bug_when>
    <thetext>So do we need to keep doing what we are doing, but also set the multiplier in addition?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141866</commentid>
    <comment_count>7</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-13 10:15:23 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; So do we need to keep doing what we are doing, but also set the multiplier
&gt; in addition?

First step is this patch. It should not change the testing behavior, but is just a cleaner way to integrate testharness.js.

Then, we may consider using multiplier, which actually changes the testing behavior. It may be the case that a subtest is timeouting but not the whole test file. Using multiplier may make the whole test file timeouting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142017</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-11-13 19:53:02 -0800</bug_when>
    <thetext>I&apos;m not sure if I follow. I do not object to this patch, just don&apos;t understand what we are up to.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142042</commentid>
    <comment_count>9</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-14 01:20:54 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; I&apos;m not sure if I follow. I do not object to this patch, just don&apos;t
&gt; understand what we are up to.

This patch does two things:
1. Remove WebKit custom changes to testharness.js. For future syncing of testharness.js, we will no longer need to port WebKit changes to the new testharness.js. This will also allow bug 150332 which ensures that web-platform-test tests use the expected testharness.js version.
2. Update testharnessreport.js to disable testharness.js per-file timeout that would otherwise kick in before WebKit timeout due to changes done in step 1.

Basically, this patch does not change anything except that it uses testharness.js/testharnessreport.js in a proper manner.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142061</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-11-14 12:05:35 -0800</bug_when>
    <thetext>Let&apos;s consider a test that currently takes 15 seconds, and doesn&apos;t have a per-file timeout. It currently passes on Mac, because run-webkit-tests timeout is 30 seconds.

What will keep it passing after these changes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142072</commentid>
    <comment_count>11</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-14 16:15:18 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; Let&apos;s consider a test that currently takes 15 seconds, and doesn&apos;t have a
&gt; per-file timeout. It currently passes on Mac, because run-webkit-tests
&gt; timeout is 30 seconds.
&gt; 
&gt; What will keep it passing after these changes?

This test will see no change as this test is not testharness.js based.

A test with testharness.js currently always has a per-file js-controlled timeout, which is set to a big value.
After this change, all testharness.js tests will no longer have per-test js-controlled timeouts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142113</commentid>
    <comment_count>12</comment_count>
      <attachid>265481</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-11-15 08:01:51 -0800</bug_when>
    <thetext>Comment on attachment 265481
Patch

Clearing flags on attachment: 265481

Committed r192461: &lt;http://trac.webkit.org/changeset/192461&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142114</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-11-15 08:01:54 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142118</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-11-15 10:45:24 -0800</bug_when>
    <thetext>&gt; A test with testharness.js currently always has a per-file js-controlled timeout, which is set to a big value.

In comment 9, you said that opposite - that &quot;per-file timeout that would otherwise kick in before WebKit timeout&quot;.

I still don&apos;t understand this change. It may be correct, but the explanations are self-contradicting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142126</commentid>
    <comment_count>15</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-15 11:33:27 -0800</bug_when>
    <thetext>(In reply to comment #14)
&gt; &gt; A test with testharness.js currently always has a per-file js-controlled timeout, which is set to a big value.
&gt; 
&gt; In comment 9, you said that opposite - that &quot;per-file timeout that would
&gt; otherwise kick in before WebKit timeout&quot;.

I am sorry if my explanations are not clear enough, but I do not see any contradiction between c9 and c14.
Here is another try.

Before this patch, the situation is as follow:
- testharness.js sets a per-file JS timeout of 1000 seconds (c14)
- WKR sets a WK timeout of 30 seconds in debug mode
- testharnessreport.js does not change testharness.js JS timeout
Conclusion:
- testharness.js JS timeout never kicks in

After this patch, the situation can be described as follow:
- testharness.js sets a per-file JS timeout of 10 seconds
- WKR sets a WK timeout of 30 seconds in debug mode, hence why the JS timeout would kick (c9) in except that...
- testharnessreport.js disables testharness.js JS timeout
Conclusion:
- testharness.js JS timeout never kicks in

Is that clearer?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142132</commentid>
    <comment_count>16</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-11-15 13:17:16 -0800</bug_when>
    <thetext>Where does the phrase &quot;per-file timeout&quot; come from? I don&apos;t see it in code.

What this patch does is change default timeout in testharness.js, not a &quot;per-file timeout&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142199</commentid>
    <comment_count>17</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-16 02:13:35 -0800</bug_when>
    <thetext>(In reply to comment #16)
&gt; Where does the phrase &quot;per-file timeout&quot; come from? I don&apos;t see it in code.

Ah, maybe that is where the confusion comes from.
This term was only coined as part of this discussion (#c4).

To summarize, each testharness.js test is guarded by 3 different timeout mechanisms:
1. WTR timeout (global &quot;per-test-file&quot; timeout)
2. testharness.js Tests.timeout_id (global &quot;per-test-file&quot; timeout, default length defined by harness_timeout)
3. testharness.js  Test.timeout_id (&quot;per-test&quot; timeout, disabled by default, can be set for each test/async_test explicitly in the html test file).

What this patch does is disabling the second timeout, Tests.timeout_id.

&gt; What this patch does is change default timeout in testharness.js, not a
&gt; &quot;per-file timeout&quot;.

It does so because this patch also ensures Tests.timeout_id is always cleared during testharness setup phase.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142247</commentid>
    <comment_count>18</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-11-16 09:56:02 -0800</bug_when>
    <thetext>&gt; 2. testharness.js Tests.timeout_id (global &quot;per-test-file&quot; timeout, default length defined by harness_timeout)
&gt; 3. testharness.js  Test.timeout_id (&quot;per-test&quot; timeout, disabled by default, can be set for each test/async_test explicitly in the html test file).

What is the difference between &quot;per-test-file&quot; and &quot;per-test&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142251</commentid>
    <comment_count>19</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-16 10:14:50 -0800</bug_when>
    <thetext>&gt; What is the difference between &quot;per-test-file&quot; and &quot;per-test&quot;?

per-test-file means the execution of a whole HTML file.
per-test means the execution of JS code inside a test() or async_test() block.

As can be seen in LayputTests/streams/reference-implementation, a single HTML test file may contain several tests.

Testharness.js defines Tests and Test to handle that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142253</commentid>
    <comment_count>20</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2015-11-16 10:25:17 -0800</bug_when>
    <thetext>https://darobin.github.io/test-harness-tutorial/docs/using-testharness.html contains useful information.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>265481</attachid>
            <date>2015-11-13 08:58:13 -0800</date>
            <delta_ts>2015-11-15 08:01:51 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-151262-20151113175806.patch</filename>
            <type>text/plain</type>
            <size>2376</size>
            <attacher name="youenn fablet">youennf</attacher>
            
              <data encoding="base64">U3V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