Merge "Protect against builds dict changing while we iterate" into feature/zuulv3
diff --git a/zuul/executor/client.py b/zuul/executor/client.py
index 0e6544b..2ca69fc 100644
--- a/zuul/executor/client.py
+++ b/zuul/executor/client.py
@@ -445,7 +445,9 @@
 
     def lookForLostBuilds(self):
         self.log.debug("Looking for lost builds")
-        for build in self.builds.values():
+        # Construct a list from the values iterator to protect from it changing
+        # out from underneath us.
+        for build in list(self.builds.values()):
             if build.result:
                 # The build has finished, it will be removed
                 continue