Patchwork D5557: testrunner: make `-j100 --runs-per-test=100 test-foo.t` use 100 jobs

login
register
mail settings
Submitter phabricator
Date Jan. 10, 2019, 10:42 p.m.
Message ID <cc863773e6a2cb97b63bc8fd709be7e0@localhost.localdomain>
Download mbox | patch
Permalink /patch/37638/
State Not Applicable
Headers show

Comments

phabricator - Jan. 10, 2019, 10:42 p.m.
martinvonz updated this revision to Diff 13152.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5557?vs=13151&id=13152

REVISION DETAIL
  https://phab.mercurial-scm.org/D5557

AFFECTED FILES
  tests/run-tests.py
  tests/test-run-tests.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -716,6 +716,12 @@ 
 (delete the duplicated test file)
   $ rm test-failure-copy.t
 
+multiple runs per test should be parallelized
+
+  $ rt --jobs 2 --runs-per-test 2 test-success.t
+  running 2 tests using 2 parallel processes 
+  ..
+  # Ran 2 tests, 0 skipped, 0 failed.
 
 Interactive run
 ===============
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2859,8 +2859,9 @@ 
                     testdescs = orig
 
             tests = [self._gettest(d, i) for i, d in enumerate(testdescs)]
-
-            jobs = min(len(tests), self.options.jobs)
+            num_tests = len(tests) * self.options.runs_per_test
+
+            jobs = min(num_tests, self.options.jobs)
 
             failed = False
             kws = self.options.keywords
@@ -2897,7 +2898,7 @@ 
                     self._installchg()
 
                 log('running %d tests using %d parallel processes' % (
-                    len(tests), jobs))
+                    num_tests, jobs))
 
                 result = runner.run(suite)