From dda6c91ef8a7b47e49429bb05197c26d58cd2896 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 29 Jul 2013 14:12:12 -0700 Subject: [PATCH] Use the public gear API to iterate over jobs in the queue Also, add some more info about testing. Change-Id: I2029a03d2ab017d826b01dc0b802c6e0e0328204 --- TESTING.rst | 6 ++++++ tests/test_scheduler.py | 26 ++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/TESTING.rst b/TESTING.rst index f3fa28e7cd..293bb8370c 100644 --- a/TESTING.rst +++ b/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? --------------- diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index 85eb8adec0..e539f55235 100644 --- a/tests/test_scheduler.py +++ b/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) +