Patchwork run-tests.py: force test-import-modules.t to run in the beginning

login
register
mail settings
Submitter Siddharth Agarwal
Date March 27, 2015, 8:51 p.m.
Message ID <bc4b5976a2474029a8fe.1427489471@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8317/
State Rejected
Headers show

Comments

Siddharth Agarwal - March 27, 2015, 8:51 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1427489465 25200
#      Fri Mar 27 13:51:05 2015 -0700
# Node ID bc4b5976a2474029a8fe1133b5666e811a1de2ee
# Parent  d9674bec56ff82499822987f6fa79286b434038e
run-tests.py: force test-import-modules.t to run in the beginning

This is a short file that takes a very long time to run. The scaling factor of
10 wasn't enough to make it run towards the beginning, so increase it to 100.

On a 16-core, 32-thread machine, ./run-tests.py -j32 went down from 2:30 to
1:48.
Martin von Zweigbergk - March 27, 2015, 8:56 p.m.
On Fri, Mar 27, 2015 at 1:53 PM Siddharth Agarwal <sid0@fb.com> wrote:

> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1427489465 25200
> #      Fri Mar 27 13:51:05 2015 -0700
> # Node ID bc4b5976a2474029a8fe1133b5666e811a1de2ee
> # Parent  d9674bec56ff82499822987f6fa79286b434038e
> run-tests.py: force test-import-modules.t to run in the beginning
>
> This is a short file that takes a very long time to run. The scaling
> factor of
> 10 wasn't enough to make it run towards the beginning, so increase it to
> 100.
>

Why not 1e9?


>
> On a 16-core, 32-thread machine, ./run-tests.py -j32 went down from 2:30 to
> 1:48.
>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -1592,7 +1592,7 @@
>              random.shuffle(tests)
>          else:
>              # keywords for slow tests
> -            slow = 'svn gendoc check-code-hg'.split()
> +            slow = 'svn gendoc check-code-hg test-module-imports'.split()
>              def sortkey(f):
>                  # run largest tests first, as they tend to take the
> longest
>                  try:
> @@ -1603,7 +1603,7 @@
>                      return -1e9 # file does not exist, tell early
>                  for kw in slow:
>                      if kw in f:
> -                        val *= 10
> +                        val *= 100
>                  return val
>              tests.sort(key=sortkey)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
Siddharth Agarwal - March 27, 2015, 9:04 p.m.
On 03/27/2015 01:56 PM, Martin von Zweigbergk wrote:
>
> Why not 1e9?

100 was good enough in my testing. I'm pretty indifferent to the values
as long as they get the desired effect.
Martin von Zweigbergk - March 27, 2015, 9:11 p.m.
On Fri, Mar 27, 2015 at 2:04 PM Siddharth Agarwal <sid@less-broken.com>
wrote:

> On 03/27/2015 01:56 PM, Martin von Zweigbergk wrote:
> >
> > Why not 1e9?
>
> 100 was good enough in my testing. I'm pretty indifferent to the values
> as long as they get the desired effect.
>

100 just seemed arbitrary, and while 1e9 is also arbitrary, it seems more
clearly about always putting it first (and -1e9 was used above). But not a
big deal either way, of course.
Matt Mackall - March 28, 2015, 5:33 a.m.
On Fri, 2015-03-27 at 21:11 +0000, Martin von Zweigbergk wrote:
> On Fri, Mar 27, 2015 at 2:04 PM Siddharth Agarwal <sid@less-broken.com>
> wrote:
> 
> > On 03/27/2015 01:56 PM, Martin von Zweigbergk wrote:
> > >
> > > Why not 1e9?
> >
> > 100 was good enough in my testing. I'm pretty indifferent to the values
> > as long as they get the desired effect.
> >
> 
> 100 just seemed arbitrary, and while 1e9 is also arbitrary, it seems more
> clearly about always putting it first (and -1e9 was used above). But not a
> big deal either way, of course.

I spent a while this evening tinkering with ways to make the test
actually faster. I got it down to 3s, so I'm going to drop this.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1592,7 +1592,7 @@ 
             random.shuffle(tests)
         else:
             # keywords for slow tests
-            slow = 'svn gendoc check-code-hg'.split()
+            slow = 'svn gendoc check-code-hg test-module-imports'.split()
             def sortkey(f):
                 # run largest tests first, as they tend to take the longest
                 try:
@@ -1603,7 +1603,7 @@ 
                     return -1e9 # file does not exist, tell early
                 for kw in slow:
                     if kw in f:
-                        val *= 10
+                        val *= 100
                 return val
             tests.sort(key=sortkey)