Mercurial > hg
annotate contrib/showstack.py @ 27394:b4d7743e174a
run-tests: add more scheduling weight hints
The scheduler would like to order test execution by expected run-time,
but doesn't know much about how long a test will run. It thus uses
test size as a proxy for run-time. By tweaking these weights we can
keep CPUs more evenly busy and thus finish sooner.
In particular, this change pushes the three currently longest-running
tests closer to the beginning:
test-largefiles-update.t
test-run-tests.t
test-gendoc.t
As the largefiles test is currently the long pole of the test suite
with higher -j factors, the sooner it's started, the sooner the tests
can end.
We also up the weight on some shorter but long-running tests that
could have previously delayed completion with low -j factors by
running very close to the end.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 04 Dec 2015 17:05:20 -0600 |
parents | bdac264e5ed4 |
children | f2fe7b199bb4 |
rev | line source |
---|---|
26123
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
1 # showstack.py - extension to dump a Python stack trace on signal |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
2 # |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
3 # binds to both SIGQUIT (Ctrl-\) and SIGINFO (Ctrl-T on BSDs) |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
4 |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
5 import sys, signal, traceback |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
6 |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
7 def sigshow(*args): |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
8 sys.stderr.write("\n") |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
9 traceback.print_stack(args[1], limit=10, file=sys.stderr) |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
10 sys.stderr.write("----\n") |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
11 |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
12 def extsetup(ui): |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
13 signal.signal(signal.SIGQUIT, sigshow) |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
14 try: |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
15 signal.signal(signal.SIGINFO, sigshow) |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
16 except AttributeError: |
bdac264e5ed4
contrib: add showstack extension
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
17 pass |