diff options
author | huanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 18:34:10 +0000 |
---|---|---|
committer | huanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 18:34:10 +0000 |
commit | b9ff2d73077956314c09e479fe77df4670c986df (patch) | |
tree | c2333481d3ad8c4c554616b2c0cd6d1e7131129a | |
parent | b7471cad55970463874d21d9ba25c00a531c6fc9 (diff) | |
download | chromium_src-b9ff2d73077956314c09e479fe77df4670c986df.zip chromium_src-b9ff2d73077956314c09e479fe77df4670c986df.tar.gz chromium_src-b9ff2d73077956314c09e479fe77df4670c986df.tar.bz2 |
Running UI tests with slices under purify.
BUG=16006
TEST=none.
Review URL: http://codereview.chromium.org/149600
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20632 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | tools/purify/chrome_tests.py | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/tools/purify/chrome_tests.py b/tools/purify/chrome_tests.py index 0394d8d..b8c9a03 100644 --- a/tools/purify/chrome_tests.py +++ b/tools/purify/chrome_tests.py @@ -329,7 +329,7 @@ class ChromeTests: return 88 return 0 - def TestUI(self): + def TestUIAll(self): if not self._options.no_reinstrument: instrumentation_error = self.InstrumentDll() if instrumentation_error: @@ -343,6 +343,66 @@ class ChromeTests: "--ui-test-sleep-timeout=40000"], multi=True) + def TestUI(self): + # Similar to layout test, we run a slice of UI tests with each run. + # This is achieved by using --batch-count (total number of slices) and + # --batch-index (current slice index) command line switches of UI tests. + # A "batch index file" is maintained in the local directory so that each + # test runs the kth slice of UI tests and increments k for next run. + # Note: a full cycle of UI tests is finished in batch_count runs. + # If new test cases are added in the middle of a cycle, some tests + # may get skipped in the current cycle. For more discussion on this issue, + # see http://codereview.chromium.org/149600. + + # Break UI tests into 30 slices so we have about 30 minutes per run. + batch_count = 30 + batch_index = 0 + batch_index_file = os.path.join(os.environ["TEMP"], + "purify_ui_batch_index.txt") + try: + f = open(batch_index_file) + if f: + str = f.read() + if len(str): + batch_index = int(str) + if batch_index >= batch_count: + batch_index = 0 + f.close() + except IOError, (errno, strerror): + logging.error("error reading from file %s (%d, %s)" % (batch_index_file, + errno, strerror)) + + script_cmd = ["ui_tests.exe", "--single-process", + "--ui-test-timeout=180000", + "--ui-test-action-timeout=80000", + "--ui-test-action-max-timeout=180000", + "--ui-test-sleep-timeout=40000", + "--batch-count=%s" % batch_count, + "--batch-index=%s" % batch_index] + + ret = self.ScriptedTest("chrome", "chrome.exe", "ui_tests", + script_cmd, multi=True) + + # Wait until after the test runs to completion to write out the new batch + # index. This way, if the bot is killed, we'll start running again from + # the current chunk rather than skipping it. + try: + f = open(batch_index_file, "w") + batch_index += 1 + if batch_index == batch_count: + batch_index = 0 + f.write("%d" % batch_index) + f.close() + except IOError, (errno, strerror): + logging.error("error writing to file %s (%d, %s)" % (batch_index_file, + errno, strerror)) + + # As we just started to run full pass UI test under purify, there are a + # fair number of test errors. + if ret: + return 88 + return 0 + def TestV8(self): shell = "v8_shell.exe" # We need to compute _build_dir early to in order to pass in the |