From 54bfda5a077e85f314b0c8e91d118a8827c696a9 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 7 Feb 2020 08:45:52 -0800 Subject: [PATCH] Fix test race with paused build The waitUntilSettled test method can return early in the case of a paused build if checks the builds between when the executor pauses it and the scheduler is notified. To avoid this, have waitUntilSettled check whether the scheduler thinks the build is paused rather than the executor. Change-Id: I24d48955efe9f27f3d2bd876b27d39b55f79ca17 --- tests/base.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/base.py b/tests/base.py index 334dcb834f..8ff1d65eb6 100644 --- a/tests/base.py +++ b/tests/base.py @@ -3925,11 +3925,12 @@ class ZuulTestCase(BaseTestCase): worker_build = self.executor_server.job_builds.get( server_job.unique.decode('utf8')) if worker_build: - if worker_build.isWaiting() or worker_build.paused: + if build.paused: continue - else: - self.log.debug("%s is running" % worker_build) - return False + if worker_build.isWaiting(): + continue + self.log.debug("%s is running" % worker_build) + return False else: self.log.debug("%s is unassigned" % server_job) return False