Use the public gear API to iterate over jobs in the queue

Also, add some more info about testing.

Change-Id: I2029a03d2ab017d826b01dc0b802c6e0e0328204
This commit is contained in:
James E. Blair 2013-07-29 14:12:12 -07:00
parent b56af88498
commit dda6c91ef8
2 changed files with 18 additions and 14 deletions

View File

@ -61,6 +61,12 @@ to set up the virtualenv)::
.tox/py27/bin/python -m testtools.run tests.test_scheduler.TestScheduler.test_jobs_launched .tox/py27/bin/python -m testtools.run tests.test_scheduler.TestScheduler.test_jobs_launched
List Failing Tests
------------------
.tox/py27/bin/activate
testr failing --list
Need More Info? Need More Info?
--------------- ---------------

View File

@ -648,20 +648,18 @@ class FakeGearmanServer(gear.Server):
qlen = (len(self.high_queue) + len(self.normal_queue) + qlen = (len(self.high_queue) + len(self.normal_queue) +
len(self.low_queue)) len(self.low_queue))
self.log.debug("releasing queued job %s (%s)" % (regex, qlen)) self.log.debug("releasing queued job %s (%s)" % (regex, qlen))
for queue in [self.high_queue, self.normal_queue, self.low_queue]: for job in self.getQueue():
queue = queue[:] cmd, name = job.name.split(':')
for job in queue: if cmd != 'build':
cmd, name = job.name.split(':') continue
if cmd != 'build': if not regex or re.match(regex, name):
continue self.log.debug("releasing queued job %s" %
if not regex or re.match(regex, name): job.unique)
self.log.debug("releasing queued job %s" % job.waiting = False
job.unique) released = True
job.waiting = False else:
released = True self.log.debug("not releasing queued job %s" %
else: job.unique)
self.log.debug("not releasing queued job %s" %
job.unique)
if released: if released:
self.wakeConnections() self.wakeConnections()
qlen = (len(self.high_queue) + len(self.normal_queue) + qlen = (len(self.high_queue) + len(self.normal_queue) +