summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorcharleslee@chromium.org <charleslee@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-27 02:29:31 +0000
committercharleslee@chromium.org <charleslee@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-27 02:29:31 +0000
commit1ad202002e9bf68fac12cb38d53d04ffcf0eb2f7 (patch)
treeb02f905d03573acad1a1565955066411ce5e5f76 /tools
parent000216bf8f9e65726df376d6cec16ab87f725fe0 (diff)
downloadchromium_src-1ad202002e9bf68fac12cb38d53d04ffcf0eb2f7.zip
chromium_src-1ad202002e9bf68fac12cb38d53d04ffcf0eb2f7.tar.gz
chromium_src-1ad202002e9bf68fac12cb38d53d04ffcf0eb2f7.tar.bz2
Random seed generator for sharding_supervisor
Added --random-seed flag BUG=89737 Review URL: http://codereview.chromium.org/7461103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/sharding_supervisor/sharding_supervisor.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/sharding_supervisor/sharding_supervisor.py b/tools/sharding_supervisor/sharding_supervisor.py
index 5ad9f71..f25026f 100755
--- a/tools/sharding_supervisor/sharding_supervisor.py
+++ b/tools/sharding_supervisor/sharding_supervisor.py
@@ -19,6 +19,7 @@ import optparse
import os
import pty
import Queue
+import random
import re
import subprocess
import sys
@@ -292,6 +293,8 @@ def main():
"--reorder", action="store_true",
help="ensure that all output from an earlier shard is printed before"
" output from a later shard")
+ parser.add_option("--random-seed", action="store_true",
+ help="shuffle the tests with a random seed value")
parser.disable_interspersed_args()
(options, args) = parser.parse_args()
@@ -313,6 +316,10 @@ def main():
gtest_args = ["--gtest_color=%s" % {
True: "yes", False: "no"}[options.color]] + args[1:]
+ if options.random_seed:
+ seed = random.randint(1, 99999)
+ gtest_args.extend(["--gtest_shuffle", "--gtest_random_seed=%i" % seed])
+
if options.runshard != None:
# run a single shard and exit
if (options.runshard < 0 or options.runshard >= num_shards):