Merge "Fix race in waitUntilSettled" into feature/zuulv3

This commit is contained in:
Jenkins 2017-02-07 15:18:56 +00:00 committed by Gerrit Code Review
commit f10f985b2f
1 changed files with 7 additions and 2 deletions

View File

@ -1609,10 +1609,15 @@ class ZuulTestCase(BaseTestCase):
self.eventQueuesJoin()
self.sched.run_handler_lock.acquire()
if (not self.merge_client.jobs and
all(self.eventQueuesEmpty()) and
self.haveAllBuildsReported() and
self.areAllBuildsWaiting() and
self.areAllNodeRequestsComplete()):
self.areAllNodeRequestsComplete() and
all(self.eventQueuesEmpty())):
# The queue empty check is placed at the end to
# ensure that if a component adds an event between
# when locked the run handler and checked that the
# components were stable, we don't erroneously
# report that we are settled.
self.sched.run_handler_lock.release()
self.launch_server.lock.release()
self.log.debug("...settled.")