Merge "Fix race is test_zookeeper_disconnect"

This commit is contained in:
Zuul 2021-10-28 21:02:03 +00:00 committed by Gerrit Code Review
commit a0b83ca83b
1 changed files with 9 additions and 0 deletions

View File

@ -6176,6 +6176,15 @@ For CI problems and help debugging, contact ci@example.org"""
self.scheds.execute(lambda app: app.sched.zk_client.client.stop())
self.scheds.execute(lambda app: app.sched.zk_client.client.start())
self.fake_nodepool.unpause()
# Wait until we win the nodepool election in order to avoid a
# race in waitUntilSettled with the request being fulfilled
# without submitting an event.
for x in iterate_timeout(60, 'nodepool election won'):
found = [app for app in self.scheds
if (app.sched.nodepool.election_won and
app.sched.nodepool.election.is_still_valid())]
if found:
break
self.waitUntilSettled()
self.assertEqual(A.data['status'], 'MERGED')