Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 533ce48

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
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: #9228 PR-URL: #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>
1 parent 9d5e7f5 commit 533ce48
Copy full SHA for 533ce48

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Open diff view settings
Collapse file

‎tools/test.py‎

Copy file name to clipboardExpand all lines: tools/test.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import utils
4444
import multiprocessing
4545
import errno
46+
import copy
4647

4748
from os.path import join, dirname, abspath, basename, isdir, exists
4849
from datetime import datetime
@@ -796,7 +797,9 @@ def AddTestsToList(self, result, current_path, path, context, arch, mode):
796797
tests = self.GetConfiguration(context).ListTests(current_path, path,
797798
arch, mode)
798799
for t in tests: t.variant_flags = v
799-
result += tests * context.repeat
800+
result += tests
801+
for i in range(1, context.repeat):
802+
result += copy.deepcopy(tests)
800803

801804
def GetTestStatus(self, context, sections, defs):
802805
self.GetConfiguration(context).GetTestStatus(sections, defs)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.