Fix race in tests

We haven't redeveloped the ability to pause ansible jobs yet.

Change-Id: Ic203440edb57c03741103f71fc55cb94e40c5629
This commit is contained in:
James E. Blair 2016-03-09 15:19:56 -08:00
parent dc7820cf88
commit bbda4706fc
1 changed files with 8 additions and 12 deletions

View File

@ -1281,19 +1281,15 @@ class ZuulTestCase(BaseTestCase):
return False
if server_job.waiting:
continue
worker_job = self.ansible_server.worker.gearman_jobs.get(
server_job.unique)
if worker_job:
if build.number is None:
self.log.debug("%s has not reported start" % worker_job)
return False
if worker_job.build.isWaiting():
continue
else:
self.log.debug("%s is running" % worker_job)
return False
if build.number is None:
self.log.debug("%s has not reported start" % build)
return False
if False: # worker_job.build.isWaiting():
# TODOv3: when we grow the ability to have fake
# ansible jobs wait, check for that here.
continue
else:
self.log.debug("%s is unassigned" % server_job)
self.log.debug("%s is running" % build)
return False
return True