Reorder settled check in tests
Because information moves from merge_client.build_sets to sched.result_event_queue, perform the merge_client check first because that is less racy in case of a context switch between the two checks. Change-Id: I0c55ee5f04a404f5ab9e3095d2cfabb10a8f64e9
This commit is contained in:
committed by
Joshua Hesketh
parent
17dd6779f0
commit
ae1b2d1d90
+2
-2
@@ -1217,10 +1217,10 @@ class ZuulTestCase(testtools.TestCase):
|
||||
self.sched.trigger_event_queue.join()
|
||||
self.sched.result_event_queue.join()
|
||||
self.sched.run_handler_lock.acquire()
|
||||
if (self.sched.trigger_event_queue.empty() and
|
||||
if (not self.merge_client.build_sets and
|
||||
self.sched.trigger_event_queue.empty() and
|
||||
self.sched.result_event_queue.empty() and
|
||||
self.fake_gerrit.event_queue.empty() and
|
||||
not self.merge_client.build_sets and
|
||||
self.haveAllBuildsReported() and
|
||||
self.areAllBuildsWaiting()):
|
||||
self.sched.run_handler_lock.release()
|
||||
|
||||
Reference in New Issue
Block a user