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

Unified Diff: testing/scripts/run_telemetry_as_googletest.py

Issue 2089633003: Shard & set hard timeout for telemetry_perf_unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for landing Created 4 years, 6 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
« testing/buildbot/chromium.linux.json ('K') | « testing/buildbot/chromium.win.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/scripts/run_telemetry_as_googletest.py
diff --git a/testing/scripts/run_telemetry_as_googletest.py b/testing/scripts/run_telemetry_as_googletest.py
index 8a4cd63dd90223c96cd13c153dd02ef47bf3de5c..f7bdcc00c0880554c17ba6de8a7383af11ec8065 100755
--- a/testing/scripts/run_telemetry_as_googletest.py
+++ b/testing/scripts/run_telemetry_as_googletest.py
@@ -47,9 +47,24 @@ def main():
xvfb_proc, openbox_proc, xcompmgr_proc = xvfb.start_xvfb(env=env,
build_dir='.')
assert xvfb_proc and openbox_proc and xcompmgr_proc, 'Failed to start xvfb'
+ # Compatibility with gtest-based sharding.
+ total_shards = None
+ shard_index = None
+ if 'GTEST_TOTAL_SHARDS' in env:
+ total_shards = int(env['GTEST_TOTAL_SHARDS'])
+ del env['GTEST_TOTAL_SHARDS']
+ if 'GTEST_SHARD_INDEX' in env:
+ shard_index = int(env['GTEST_SHARD_INDEX'])
+ del env['GTEST_SHARD_INDEX']
+ sharding_args = []
+ if total_shards is not None and shard_index is not None:
+ sharding_args = [
+ '--total-shards=%d' % total_shards,
+ '--shard-index=%d' % shard_index
+ ]
try:
with common.temporary_file() as tempfile_path:
- rc = common.run_command([sys.executable] + rest_args + [
+ rc = common.run_command([sys.executable] + rest_args + sharding_args + [
'--write-full-results-to', tempfile_path,
], env=env)
with open(tempfile_path) as f:
« testing/buildbot/chromium.linux.json ('K') | « testing/buildbot/chromium.win.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698