Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: tools/run-tests.py

Issue 231443002: Improve reproducibility of test runs. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Address nit Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | tools/testrunner/local/execution.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/run-tests.py
diff --git a/tools/run-tests.py b/tools/run-tests.py
index e6cb5a59ad6d34c70502a05b47c4206ec3e771e3..b1b86adc2b61c1d47f3194fc04d9815b7edbfa29 100755
--- a/tools/run-tests.py
+++ b/tools/run-tests.py
@@ -34,6 +34,7 @@ import optparse
import os
from os.path import join
import platform
+import random
import shlex
import subprocess
import sys
@@ -200,6 +201,8 @@ def BuildOptions():
result.add_option("--junittestsuite",
help="The testsuite name in the JUnit output file",
default="v8tests")
+ result.add_option("--random-seed", default=0, dest="random_seed",
+ help="Default seed for initializing random generator")
return result
@@ -250,6 +253,9 @@ def ProcessOptions(options):
if options.j == 0:
options.j = multiprocessing.cpu_count()
+ while options.random_seed == 0:
+ options.random_seed = random.SystemRandom().randint(-2147483648, 2147483647)
+
def excl(*args):
"""Returns true if zero or one of multiple arguments are true."""
return reduce(lambda x, y: x + y, args) <= 1
@@ -396,7 +402,8 @@ def Execute(arch, mode, args, options, suites, workspace):
timeout, options.isolates,
options.command_prefix,
options.extra_flags,
- options.no_i18n)
+ options.no_i18n,
+ options.random_seed)
# TODO(all): Combine "simulator" and "simulator_run".
simulator_run = not options.dont_skip_simulator_slow_tests and \
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | tools/testrunner/local/execution.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698