Merge "Remove noop builds from builds list"

This commit is contained in:
Zuul
2021-08-17 17:42:30 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 12 deletions

View File

@@ -5151,15 +5151,6 @@ class ZuulTestCase(BaseTestCase):
for build in builds:
seen_builds.add(build.uuid)
# Noop jobs are now added to the local build list in the
# executor client, so they can be looked up in the scheduler
# when the build result events are processed.
# As most of the following tests don't make much sense for
# those builds and they are - per definition - completed
# immediately, we can simply skip them.
if build.job.name == "noop":
continue
if not build.build_request_ref:
self.log.debug("%s has not been submitted", build)
return False

View File

@@ -14,6 +14,7 @@
import logging
import time
from contextlib import suppress
from uuid import uuid4
import zuul.executor.common
@@ -214,16 +215,18 @@ class ExecutorClient(object):
log = get_annotated_logger(self.log, build.zuul_event_id)
log.debug("Removing build %s", build.uuid)
with suppress(KeyError):
del self.builds[build.uuid]
if not build.build_request_ref:
log.debug("Build has not been submitted to ZooKeeper")
log.debug("Build %s has not been submitted to ZooKeeper",
build.uuid)
return
build_request = self.executor_api.get(build.build_request_ref)
if build_request:
self.executor_api.remove(build_request)
del self.builds[build.uuid]
def cleanupLostBuildRequests(self):
for build_request in self.executor_api.lostRequests():
try: