diff options
author | sky <sky@chromium.org> | 2015-06-10 13:42:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-10 20:42:36 +0000 |
commit | 0216c9f87af7d6f25265cd93b34071fb8268db21 (patch) | |
tree | 05de8cf774be76865d0022d56dc86b45d0d85ac2 /mojo | |
parent | 984f779607cc0ca56de0326dcf0f9ee86c8486ef (diff) | |
download | chromium_src-0216c9f87af7d6f25265cd93b34071fb8268db21.zip chromium_src-0216c9f87af7d6f25265cd93b34071fb8268db21.tar.gz chromium_src-0216c9f87af7d6f25265cd93b34071fb8268db21.tar.bz2 |
Fixes viewmanager tests on android
There were two things causing flake:
. The bounds of the root asynchronously changes.
. Similarly the metrics are asynchronously available.
As tests expect certain things to happen in a certain order these were
causing problems.
As we don't care about these cases I've ignored tracking them. This
makes the test cleanly pass now.
I also added --repeat-count to the apptest_runner.
BUG=497920
TEST=test only change
R=msw@chromium.org
Review URL: https://codereview.chromium.org/1174993002
Cr-Commit-Position: refs/heads/master@{#333793}
Diffstat (limited to 'mojo')
-rwxr-xr-x | mojo/tools/apptest_runner.py | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/mojo/tools/apptest_runner.py b/mojo/tools/apptest_runner.py index d33fbea..269ff70 100755 --- a/mojo/tools/apptest_runner.py +++ b/mojo/tools/apptest_runner.py @@ -22,6 +22,8 @@ def main(): help="a file listing apptests to run") parser.add_argument("build_dir", type=str, help="the build output directory") parser.add_argument("--verbose", default=False, action='store_true') + parser.add_argument('--repeat_count', default=1, metavar='INT', + action='store', type=int) parser.add_argument('--write-full-results-to', metavar='FILENAME', help='Path to write the JSON list of full results.') args = parser.parse_args() @@ -50,23 +52,27 @@ def main(): tests = [] passed = [] failed = [] - for test_dict in test_list: - test = test_dict["test"] - test_name = test_dict.get("name", test) - test_type = test_dict.get("type", "gtest") - test_args = test_dict.get("args", []) - - print "Running %s...%s" % (test_name, ("\n" if args.verbose else "")), - sys.stdout.flush() - - tests.append(test_name) - assert test_type in ("gtest", "gtest_isolated") - isolate = test_type == "gtest_isolated" - result = gtest.run_apptest(config, shell, test_args, test, isolate) - passed.extend([test_name] if result else []) - failed.extend([] if result else [test_name]) - print "[ PASSED ]" if result else "[ FAILED ]", - print test_name if args.verbose or not result else "" + for _ in range(args.repeat_count): + for test_dict in test_list: + test = test_dict["test"] + test_name = test_dict.get("name", test) + test_type = test_dict.get("type", "gtest") + test_args = test_dict.get("args", []) + + print "Running %s...%s" % (test_name, ("\n" if args.verbose else "")), + sys.stdout.flush() + + tests.append(test_name) + assert test_type in ("gtest", "gtest_isolated") + isolate = test_type == "gtest_isolated" + result = gtest.run_apptest(config, shell, test_args, test, isolate) + passed.extend([test_name] if result else []) + failed.extend([] if result else [test_name]) + print "[ PASSED ]" if result else "[ FAILED ]", + print test_name if args.verbose or not result else "" + + if failed: + break; print "[ PASSED ] %d apptests" % len(passed), print ": %s" % ", ".join(passed) if passed else "" |