<?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>185918</bug_id>
          
          <creation_ts>2018-05-23 12:08:35 -0700</creation_ts>
          <short_desc>test262/Runner.pm: randomize tests for performance</short_desc>
          <delta_ts>2020-06-12 19:07:00 -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>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="valerie">valerie</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>leo</cc>
    
    <cc>msaboff</cc>
    
    <cc>valerie</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit-unassigned</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1426668</commentid>
    <comment_count>0</comment_count>
    <who name="valerie">valerie</who>
    <bug_when>2018-05-23 12:08:35 -0700</bug_when>
    <thetext>If there are more than 5*max_process number of test, then shuffle the tests before allocating to child process to split up groups of small tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426682</commentid>
    <comment_count>1</comment_count>
      <attachid>341115</attachid>
    <who name="valerie">valerie</who>
    <bug_when>2018-05-23 12:24:02 -0700</bug_when>
    <thetext>Created attachment 341115
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426739</commentid>
    <comment_count>2</comment_count>
      <attachid>341115</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2018-05-23 14:45:28 -0700</bug_when>
    <thetext>Comment on attachment 341115
Patch

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

&gt; Tools/Scripts/test262/Runner.pm:296
&gt; +        @files = shuffle @files;

Anything random in tests makes me nervous because it can make reproducing results hard. Can the same result be achieved without randomness?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426750</commentid>
    <comment_count>3</comment_count>
    <who name="valerie">valerie</who>
    <bug_when>2018-05-23 15:17:55 -0700</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #2)
&gt; Comment on attachment 341115 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=341115&amp;action=review
&gt; 
&gt; &gt; Tools/Scripts/test262/Runner.pm:296
&gt; &gt; +        @files = shuffle @files;
&gt; 
&gt; Anything random in tests makes me nervous because it can make reproducing
&gt; results hard. Can the same result be achieved without randomness?

Hmm -- so this randomize the order in which the tests are run to even the load across the child processes (there are some groups of slow tests). The tests all stand alone.

I thought of alphabetizing the tests (instead of shuffle), as the &quot;slow&quot; groupings are groupings within directories, but unfortunately the naming convention is also consistent in such a way that slow tests would be grouped.

This is not a very great performance increase -- and I&apos;m not married to seeing it committed, it&apos;s just here to get feedback from Michael :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1427998</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2018-05-28 20:36:31 -0700</bug_when>
    <thetext>I think that using randomness is OK to achieve this. But it just needs to be one-time randomness with the results stored in the repository, rather than &quot;every time the tests are run&quot; randomness.

Choosing a different set every time we run tests can make problems with one test affecting another into hard-to-reproduce flakiness. And we’d like to avoid that even if it’s unlikely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1428147</commentid>
    <comment_count>5</comment_count>
    <who name="Leo Balter">leo</who>
    <bug_when>2018-05-29 11:36:23 -0700</bug_when>
    <thetext>Darin, I&apos;m taking over this patch work as Valerie is in a vacation time this week.

I&apos;m not show how we randomize and keep it for consecutive runs. The results are sorted anyway.

&gt; tests can make problems with one test affecting another into hard-to-reproduce flakiness

Every test run is isolated from each other. The only thing that could be a problem in this case is memory usage from each call to JSC (for each test). This not prevented from the current alternative - tests order as it is by their file path - anyway.

&gt; And we’d like to avoid that even if it’s unlikely.

The only guaranteed way to prevent any conflict here is to run the tests in a single process queue. That&apos;s not what being solved here, neither this patch will compromise it. Running in a single thread makes the run way slower but gives you a save ride to prevent shared memory usage from multiple JSC calls.

You should also consider Test262 has only unit tests - as a maintainer I can guarantee that - and we don&apos;t run anything such as stress tests or anything relying on performance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1662296</commentid>
    <comment_count>6</comment_count>
      <attachid>341115</attachid>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-06-12 19:07:00 -0700</bug_when>
    <thetext>Comment on attachment 341115
Patch

Putting r- based on Darin&apos;s comment about one-time randomness.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>341115</attachid>
            <date>2018-05-23 12:24:02 -0700</date>
            <delta_ts>2020-06-12 19:07:00 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-185918-20180523152400.patch</filename>
            <type>text/plain</type>
            <size>1298</size>
            <attacher name="valerie">valerie</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjMyMTE5CmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggYjkxM2EyMmIyNjZmYjE3ZWJmNmM5N2QyN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TUVXT1JLX1BBVEgpOwog
dXNlIENvbmZpZzsKIHVzZSBUaW1lOjpIaVJlcyBxdyh0aW1lKTsKK3VzZSBMaXN0OjpVdGlsIHF3
KHNodWZmbGUpOwogCiBteSAkQmluOwogQkVHSU4gewpAQCAtMjkyLDYgKzI5Myw4IEBAIHN1YiBt
YWluIHsKICAgICAjIElmIHdlIGFyZSBwcm9jZXNzaW5nIG1hbnkgZmlsZXMsIGZvcmsgcHJvY2Vz
cwogICAgIGlmIChzY2FsYXIgQGZpbGVzID4gJG1heF9wcm9jZXNzICogNSkgewogCisgICAgICAg
IEBmaWxlcyA9IHNodWZmbGUgQGZpbGVzOworCiAgICAgICAgICMgTWFrZSB0ZW1wb3JhcnkgZmls
ZXMgdG8gcmVjb3JkIHJlc3VsdHMKICAgICAgICAgbXkgQHJlc3VsdHNmaHM7CiAgICAgICAgIGZv
ciAobXkgJGkgPSAwOyAkaSA8PSAkbWF4X3Byb2Nlc3MtMTsgJGkrKykgewo=
</data>
<flag name="review"
          id="359319"
          type_id="1"
          status="-"
          setter="ysuzuki"
    />
          </attachment>
      

    </bug>

</bugzilla>