diff --git a/test/common/tmpdir.js b/test/common/tmpdir.js index 33b2264a8d69f5..92bcc9521a8bdb 100644 --- a/test/common/tmpdir.js +++ b/test/common/tmpdir.js @@ -89,7 +89,8 @@ const testRoot = process.env.NODE_TEST_DIR ? // Using a `.` prefixed name, which is the convention for "hidden" on POSIX, // gets tools to ignore it by default or by simple rules, especially eslint. -const tmpdirName = '.tmp.' + (process.env.TEST_THREAD_ID || '0'); +const tmpdirName = '.tmp.' + + (process.env.TEST_SERIAL_ID || process.env.TEST_THREAD_ID || '0'); const tmpPath = path.join(testRoot, tmpdirName); function refresh(opts = {}) { diff --git a/tools/test.py b/tools/test.py index ff08749425eb5a..0726619bd092a0 100755 --- a/tools/test.py +++ b/tools/test.py @@ -77,6 +77,7 @@ class ProgressIndicator(object): def __init__(self, cases, flaky_tests_mode): self.cases = cases + self.serial_id = 0 self.flaky_tests_mode = flaky_tests_mode self.parallel_queue = Queue(len(cases)) self.sequential_queue = Queue(len(cases)) @@ -146,6 +147,8 @@ def RunSingle(self, parallel, thread_id): case = test case.thread_id = thread_id self.lock.acquire() + case.serial_id = self.serial_id + self.serial_id += 1 self.AboutToRun(case) self.lock.release() try: @@ -504,6 +507,7 @@ def __init__(self, context, path, arch, mode): self.mode = mode self.parallel = False self.disable_core_files = False + self.serial_id = 0 self.thread_id = 0 def IsNegative(self): @@ -535,6 +539,7 @@ def RunCommand(self, command, env): def Run(self): try: result = self.RunCommand(self.GetCommand(), { + "TEST_SERIAL_ID": "%d" % self.serial_id, "TEST_THREAD_ID": "%d" % self.thread_id, "TEST_PARALLEL" : "%d" % self.parallel })