Index: tools/bisect-perf-regression.py |
diff --git a/tools/bisect-perf-regression.py b/tools/bisect-perf-regression.py |
index 51e639fbcbc125128bd727924118b5ac903595fa..b31b9638f5b43dbeb2398085123ebf6817fee9bd 100755 |
--- a/tools/bisect-perf-regression.py |
+++ b/tools/bisect-perf-regression.py |
@@ -54,7 +54,7 @@ import zipfile |
sys.path.append(os.path.join(os.path.dirname(__file__), 'telemetry')) |
import bisect_utils |
-import post_perf_builder_job |
+import post_perf_builder_job as bisect_builder |
from telemetry.page import cloud_storage |
# The additional repositories that might need to be bisected. |
@@ -1623,15 +1623,18 @@ class BisectPerformanceMetrics(object): |
return False |
bot_name, build_timeout = GetBuilderNameAndBuildTime(self.opts.target_arch) |
- |
+ # Build number on the tryserver. |
+ build_num = None |
+ builder_host = self.opts.builder_host |
+ builder_port = self.opts.builder_port |
# Create a unique ID for each build request posted to try server builders. |
# This ID is added to "Reason" property in build's json. |
- # TODO: Use this id to track the build status. |
- build_request_id = GetSHA1HexDigest('%s-%s' % (revision, patch)) |
+ build_request_id = GetSHA1HexDigest( |
+ '%s-%s-%s' % (revision, patch, time.time())) |
# Creates a try job description. |
- job_args = {'host': self.opts.builder_host, |
- 'port': self.opts.builder_port, |
+ job_args = {'host': builder_host, |
+ 'port': builder_port, |
'revision': 'src@%s' % revision, |
'bot': bot_name, |
'name': build_request_id |
@@ -1640,13 +1643,32 @@ class BisectPerformanceMetrics(object): |
if patch: |
job_args['patch'] = patch |
# Posts job to build the revision on the server. |
- if post_perf_builder_job.PostTryJob(job_args): |
+ if bisect_builder.PostTryJob(job_args): |
poll_interval = 60 |
+ status_check_interval = 600 |
+ last_status_check = time.time() |
start_time = time.time() |
while True: |
qyearsley
2014/05/23 23:17:16
Suggestion: Would it be clearer if this wait-loop
|
res = condition() |
qyearsley
2014/05/23 23:17:16
It's not obvious here that this condition function
|
if res: |
return res |
+ elapsed_status_check = time.time() - last_status_check |
+ # To avoid overloading tryserver with status check requests, we check |
+ # build status for every 10 mins. |
+ if elapsed_status_check > status_check_interval: |
+ last_status_check = time.time() |
+ if not build_num: |
+ # Get the build number on tryserver for the current build. |
+ build_num = bisect_builder.GetBuildNumFromBuilder( |
+ build_request_id, bot_name, builder_host, builder_port) |
+ # Check the status of build using the build number. |
+ # Note: Build is treated as PENDING if build number is not found |
+ # on the the tryserver. |
+ build_status, status_link = bisect_builder.GetBuildStatus( |
+ build_num, bot_name, builder_host, builder_port) |
+ if build_status == bisect_builder.FAILED: |
+ raise RuntimeError('Failed to build revision %s, status link %s.' % |
+ (revision, status_link)) |
elapsed_time = time.time() - start_time |
if elapsed_time > build_timeout: |
raise RuntimeError('Timed out while waiting %ds for %s build.' % |