| Index: tools/sharding_supervisor/sharding_supervisor.py
|
| ===================================================================
|
| --- tools/sharding_supervisor/sharding_supervisor.py (revision 139574)
|
| +++ tools/sharding_supervisor/sharding_supervisor.py (working copy)
|
| @@ -93,15 +93,21 @@
|
|
|
|
|
| def RemoveGTestOutput(gtest_args):
|
| - args = gtest_args[:]
|
| - current_value = GetGTestOutput(args)
|
| - if not current_value:
|
| - return gtest_args
|
| + return FilterArgs(gtest_args, '--gtest_output=');
|
|
|
| - args.remove('--gtest_output=' + current_value)
|
| - return args
|
| +def FilterArgs(args, arg_filter):
|
| + """Removes all strings in a list that don't start with |arg_filter|.
|
|
|
| + Returns:
|
| + A new, filtered list.
|
| + """
|
| + filtered_args = []
|
| + for arg in args:
|
| + if not arg.startswith(arg_filter):
|
| + filtered_args.append(arg)
|
| + return filtered_args
|
|
|
| +
|
| def AppendToXML(final_xml, generic_path, shard):
|
| """Combine the shard xml file with the final xml file."""
|
|
|
| @@ -597,6 +603,7 @@
|
| parser.error("You must have at least 1 run per core!")
|
| num_runs = num_cores * options.runs_per_core
|
|
|
| + test = args[0]
|
| gtest_args = ["--gtest_color=%s" % {
|
| True: "yes", False: "no"}[options.color]] + args[1:]
|
|
|
| @@ -623,13 +630,30 @@
|
| if (options.runshard < 0 or options.runshard >= num_shards_to_run):
|
| parser.error("Invalid shard number given parameters!")
|
| shard = RunShard(
|
| - args[0], num_shards_to_run, options.runshard, gtest_args, None, None)
|
| + test, num_shards_to_run, options.runshard, gtest_args, None, None)
|
| shard.communicate()
|
| return shard.poll()
|
|
|
| + # When running browser_tests, run InProcessBrowserTest.Empty with a longer
|
| + # timeout before running shards. This is needed to prevent timeouts on the
|
| + # first run tests on Windows XP. See: http://crbug.com/124260
|
| + if test.find("browser_tests") > -1:
|
| + args = [test]
|
| + args.extend(gtest_args)
|
| + args = FilterArgs(args, "--gtest_filter=");
|
| + args = FilterArgs(args, "--ui-test-action-max-timeout=");
|
| + args.append("--gtest_filter=InProcessBrowserTest.Empty");
|
| + args.append("--ui-test-action-max-timeout=240000");
|
| + result = subprocess.call(args,
|
| + bufsize=0,
|
| + universal_newlines=True)
|
| + # If the test fails, don't run anything else.
|
| + if result != 0:
|
| + return 1
|
| +
|
| # shard and run the whole test
|
| ss = ShardingSupervisor(
|
| - args[0], num_shards_to_run, num_runs, options.color,
|
| + test, num_shards_to_run, num_runs, options.color,
|
| options.original_order, options.prefix, options.retry_percent,
|
| options.timeout, options.total_slaves, options.slave_index, gtest_args)
|
| return ss.ShardTest()
|
|
|