Patchwork run-tests: when running in parallel, delete tmpdirs immediately

login
register
mail settings
Submitter Siddharth Agarwal
Date May 3, 2013, 10:19 p.m.
Message ID <d178d0c3755136cf99c3.1367619569@sid0x220>
Download mbox | patch
Permalink /patch/1554/
State Accepted
Commit 75031762aff2f857775611704f0025953bdfb866
Headers show

Comments

Siddharth Agarwal - May 3, 2013, 10:19 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1367619501 25200
#      Fri May 03 15:18:21 2013 -0700
# Node ID d178d0c3755136cf99c3db927e3a9821e5c422eb
# Parent  5b1eee82099afb53293265c390a07a3a5ebc2970
run-tests: when running in parallel, delete tmpdirs immediately

This is especially important if extensions that use inotify are enabled,
because it's very easy to hit the inotify max_user_instances limit without
this.
Matt Mackall - May 3, 2013, 10:31 p.m.
On Fri, 2013-05-03 at 15:19 -0700, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1367619501 25200
> #      Fri May 03 15:18:21 2013 -0700
> # Node ID d178d0c3755136cf99c3db927e3a9821e5c422eb
> # Parent  5b1eee82099afb53293265c390a07a3a5ebc2970
> run-tests: when running in parallel, delete tmpdirs immediately

Queued for default, thanks.

Patch

diff -r 5b1eee82099a -r d178d0c37551 tests/run-tests.py
--- a/tests/run-tests.py	Fri Apr 26 20:47:34 2013 -0700
+++ b/tests/run-tests.py	Fri May 03 15:18:21 2013 -0700
@@ -1125,6 +1125,8 @@  def runchildren(options, tests):
         childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)]
         childtmp = os.path.join(HGTMP, 'child%d' % j)
         childopts += ['--tmpdir', childtmp]
+        if options.keep_tmpdir:
+            childopts.append('--keep-tmpdir')
         cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job
         vlog(' '.join(cmdline))
         proc = subprocess.Popen(cmdline, executable=cmdline[0])
@@ -1293,7 +1295,8 @@  def main():
     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
     TESTDIR = os.environ["TESTDIR"] = os.getcwd()
     if options.tmpdir:
-        options.keep_tmpdir = True
+        if not options.child:
+            options.keep_tmpdir = True
         tmpdir = options.tmpdir
         if os.path.exists(tmpdir):
             # Meaning of tmpdir has changed since 1.3: we used to create