run-tests: when running in parallel, delete tmpdirs immediately stable
authorSiddharth Agarwal <sid0@fb.com>
Fri, 03 May 2013 15:18:21 -0700
branchstable
changeset 1224 f3c19de4b29c
parent 1222 01c23fd3d424
child 1225 19fe7b202b38
child 1226 0dd96ff409e9
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. [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Wed Oct 10 21:55:49 2012 +0200
+++ b/tests/run-tests.py	Fri May 03 15:18:21 2013 -0700
@@ -1120,6 +1120,8 @@
         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])
@@ -1288,7 +1290,8 @@
     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