| Index: verification/try_server.py
|
| diff --git a/verification/try_server.py b/verification/try_server.py
|
| index 45fc8b535435892c0c05e2ff56ee7a52f63723d7..d0c97d1481c1fccf52453aaead1a7f81a4fcb2e8 100644
|
| --- a/verification/try_server.py
|
| +++ b/verification/try_server.py
|
| @@ -101,7 +101,6 @@ class TryServerStatus(object):
|
| """
|
| # TODO(maruel): Use listening StatusPush instead of hammering the try
|
| # server.
|
| - logging.info('Fetching all try jobs status')
|
| for builder in self.builders:
|
| try:
|
| new_jobs = self._urlreadasjson('builders/%s/builds/_all' % builder)
|
| @@ -120,9 +119,14 @@ class TryServerStatus(object):
|
|
|
| def get_job(self, job, incremental):
|
| """Gets the build status for a try job."""
|
| - if incremental:
|
| + if incremental or unicode(job.build) not in self.jobs[job.builder]:
|
| url = 'builders/%s/builds/%s' % (job.builder, job.build)
|
| - self.jobs[job.builder][unicode(job.build)] = self._urlreadasjson(str(url))
|
| + try:
|
| + self.jobs[job.builder][unicode(job.build)] = self._urlreadasjson(
|
| + str(url))
|
| + except urllib2.HTTPError:
|
| + # The try job is way too old.
|
| + return None
|
| return self.jobs[job.builder][unicode(job.build)]
|
|
|
| def find_job(self, job, previous_jobs, reason):
|
| @@ -146,11 +150,13 @@ class TryServerStatus(object):
|
| if self.good_revisions is None:
|
| self.good_revisions = set()
|
| self.bad_revisions = set()
|
| - successes = [
|
| - set(job[u'sourceStamp'][u'changes'][0][u'revision']
|
| - for job in jobs.itervalues()
|
| - if job.get(u'results') in (SUCCESS, WARNINGS, SKIPPED))
|
| - for jobs in self.jobs.itervalues()]
|
| + successes = []
|
| + for jobs in self.jobs.itervalues():
|
| + successes.append(set())
|
| + for job in jobs.itervalues():
|
| + if (job.get(u'results', None) in (SUCCESS, WARNINGS, SKIPPED) and
|
| + len(job.get(u'sourceStamp', {}).get(u'changes', [])) >= 1):
|
| + successes[-1].add(job[u'sourceStamp'][u'changes'][0][u'revision'])
|
| good_revisions = reduce(lambda x, y: x & y, successes)
|
| new_good_revisions = good_revisions - self.good_revisions
|
| if new_good_revisions:
|
| @@ -271,10 +277,12 @@ class TryRunner(base.Verifier):
|
| cmd.extend(('--testfilter', ','.join(self.tests)))
|
| if isinstance(emails, (list, tuple)):
|
| emails = ','.join(emails)
|
| + if isinstance(emails, unicode):
|
| + emails = str(emails)
|
| if isinstance(emails, str):
|
| cmd.extend(('--email', emails))
|
| else:
|
| - assert emails is None
|
| + assert emails is None, repr(emails)
|
| trychange.TryChange(
|
| cmd,
|
| file_list=[],
|
| @@ -286,17 +294,21 @@ class TryRunner(base.Verifier):
|
| It's slow on the try server, not here.
|
| """
|
| if self.status.good_revisions is None:
|
| + logging.info('Fetching all try jobs status because of good_revisions')
|
| return False
|
| # Fetching the build status for all try jobs is expensive, so we try to
|
| # fetch the status just for the jobs we care about. We need the full set
|
| # only when we have newly pending commits and we don't know their try job
|
| # build numbers. TODO(maruel): revisit when reitveld gives us better APIs
|
| # to get the build numbers from rietveld instead from the try server.
|
| - for _, jobs in self.loop(queue, TryJobs):
|
| + for pending, jobs in self.loop(queue, TryJobs):
|
| if not jobs.try_jobs or jobs.get_state() != base.PROCESSING:
|
| continue
|
| if any(True for job in jobs.try_jobs if job.build is None):
|
| # We need to regenerate the whole data anyway.
|
| + logging.info(
|
| + 'Fetching all try jobs status because of %s' %
|
| + pending.pending_name())
|
| return False
|
| return True
|
|
|
|
|