Browse Source

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

Also, add some more info about testing.

Change-Id: I2029a03d2ab017d826b01dc0b802c6e0e0328204
changes/59/39159/1
James E. Blair 8 years ago
parent
commit
dda6c91ef8
  1. 6
      TESTING.rst
  2. 26
      tests/test_scheduler.py

6
TESTING.rst

@ -61,6 +61,12 @@ to set up the virtualenv)::
.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?
---------------

26
tests/test_scheduler.py

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

Loading…
Cancel
Save