Merge "Fix race in test_crd_check_duplicate"
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index c35fb58..76e91ce 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -3453,7 +3453,7 @@
def test_crd_check_duplicate(self):
"Test duplicate check in independent pipelines"
- self.gearman_server.hold_jobs_in_queue = True
+ self.worker.hold_jobs_in_build = True
A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A')
B = self.fake_gerrit.addFakeChange('org/project1', 'master', 'B')
check_pipeline = self.sched.layout.pipelines['check']
@@ -3476,13 +3476,14 @@
# Release jobs in order to avoid races with change A jobs
# finishing before change B jobs.
- self.gearman_server.release('.*-merge')
- self.gearman_server.release('project1-.*')
+ self.worker.release('.*-merge')
+ self.worker.release('project1-.*')
self.waitUntilSettled()
- self.gearman_server.release('.*-merge')
- self.gearman_server.release('project1-.*')
+ self.worker.release('.*-merge')
+ self.worker.release('project1-.*')
self.waitUntilSettled()
- self.gearman_server.release()
+ self.worker.hold_jobs_in_build = False
+ self.worker.release()
self.waitUntilSettled()
self.assertEqual(A.data['status'], 'NEW')