diff --git a/requirements.txt b/requirements.txt index f5525b60f1..c68299993f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ python-daemon>=2.0.4 extras statsd>=1.0.0,<3.0 voluptuous>=0.7 -gear>=0.5.4,<1.0.0 +gear>=0.5.7,<1.0.0 apscheduler>=2.1.1,<3.0 PrettyTable>=0.6,<0.8 babel>=1.0 diff --git a/tests/base.py b/tests/base.py index becc854b7c..8c96d18a52 100755 --- a/tests/base.py +++ b/tests/base.py @@ -1116,6 +1116,12 @@ class ZuulTestCase(BaseTestCase): while len(self.gearman_server.functions) < count: time.sleep(0) + def orderedRelease(self): + # Run one build at a time to ensure non-race order: + while len(self.builds): + self.release(self.builds[0]) + self.waitUntilSettled() + def release(self, job): if isinstance(job, FakeBuild): job.release() diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index 0779bfa2de..21fb04c84b 100755 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -2089,9 +2089,7 @@ class TestScheduler(ZuulTestCase): self.waitUntilSettled() # Run one build at a time to ensure non-race order: - for x in range(6): - self.release(self.builds[0]) - self.waitUntilSettled() + self.orderedRelease() self.worker.hold_jobs_in_build = False self.waitUntilSettled() @@ -3387,7 +3385,7 @@ For CI problems and help debugging, contact ci@example.org""" def test_crd_check_git_depends(self): "Test single-repo dependencies in independent pipelines" - self.gearman_server.hold_jobs_in_queue = True + self.gearman_server.hold_jobs_in_build = True A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A') B = self.fake_gerrit.addFakeChange('org/project1', 'master', 'B') @@ -3399,8 +3397,8 @@ For CI problems and help debugging, contact ci@example.org""" self.fake_gerrit.addEvent(B.getPatchsetCreatedEvent(1)) self.waitUntilSettled() - self.gearman_server.hold_jobs_in_queue = False - self.gearman_server.release() + self.orderedRelease() + self.gearman_server.hold_jobs_in_build = False self.waitUntilSettled() self.assertEqual(A.data['status'], 'NEW')