diff options
author | Rich Trott <rtrott@gmail.com> | 2016-10-23 22:00:37 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-10-26 12:15:57 -0700 |
commit | 60a78aedb9860f0f2ed26ecec5cc3c41e13fcd1c (patch) | |
tree | f3a9a95b0cc1cd6efd491279870db345ba8b5486 /tools/test.py | |
parent | 443e218544b82c02643a97666b505ffb0f18751f (diff) | |
download | node-new-60a78aedb9860f0f2ed26ecec5cc3c41e13fcd1c.tar.gz |
tools: make --repeat work with -j in test.py
The repeat option in test.py did not work as expected if `-j` was set to
more than one. Repeated tests running at the same time could share temp
directories and cause test failures. This was observed with:
tools/test.py -J --repeat=10 parallel/test-fs-watch-recursive
By using copy.deepCopy(), the repeated tests are separate objects and
not references to the same objects. Setting `thread_id` on one of them
will now not change the `thread_id` on all of them. And `thread_id` is
how the temp directory (and common.PORT as well) are determined.
Refs: https://github.com/nodejs/node/pull/9228
PR-URL: https://github.com/nodejs/node/pull/9249
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Diffstat (limited to 'tools/test.py')
-rwxr-xr-x | tools/test.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/test.py b/tools/test.py index b543010990..d57988f24d 100755 --- a/tools/test.py +++ b/tools/test.py @@ -42,6 +42,7 @@ import threading import utils import multiprocessing import errno +import copy from os.path import join, dirname, abspath, basename, isdir, exists from datetime import datetime @@ -773,7 +774,9 @@ class TestRepository(TestSuite): tests = self.GetConfiguration(context).ListTests(current_path, path, arch, mode) for t in tests: t.variant_flags = v - result += tests * context.repeat + result += tests + for i in range(1, context.repeat): + result += copy.deepcopy(tests) def GetTestStatus(self, context, sections, defs): self.GetConfiguration(context).GetTestStatus(sections, defs) |