Merge "Remove false-negative in zk test"

This commit is contained in:
Zuul
2021-10-29 01:44:14 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 3 deletions

View File

@@ -4421,6 +4421,11 @@ class BaseTestCase(testtools.TestCase):
)
def getZKWatches(self):
# TODO: The client.command method used here returns only the
# first 8k of data. That means this method can return {} when
# there actually are watches (and this happens in practice in
# heavily loaded test environments). We should replace that
# method with something more robust.
chroot = self.zk_chroot_fixture.zookeeper_chroot
data = self.zk_client.client.command(b'wchp')
ret = {}

View File

@@ -432,9 +432,6 @@ class TestExecutorApi(ZooKeeperBaseTestCase):
server.fulfillCancel(a)
server.unlock(a)
self.assertEqual(client.get(a.path).state, BuildRequest.COMPLETED)
for _ in iterate_timeout(10, "Wait for watches to be registered"):
if self.getZKWatches():
break
# Scheduler removes build request on completion
client.remove(sched_a)