summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@hp.com>2015-02-07 08:01:21 -0800
committerJoshua Hesketh <josh@nitrotech.org>2015-02-10 19:24:38 +1100
commitae1b2d1d9081723e02f02d35ec16f021fd87ed00 (patch)
tree390012846a95c07913eec9f0a3098490f24bcac5
parent17dd6779f0c1a3b8ad4665f5903f914cc7788f7f (diff)
downloadzuul-ae1b2d1d9081723e02f02d35ec16f021fd87ed00.tar.gz
Reorder settled check in tests
Because information moves from merge_client.build_sets to sched.result_event_queue, perform the merge_client check first because that is less racy in case of a context switch between the two checks. Change-Id: I0c55ee5f04a404f5ab9e3095d2cfabb10a8f64e9
-rwxr-xr-xtests/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/base.py b/tests/base.py
index afc676bc4..5ae0d3e21 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1217,10 +1217,10 @@ class ZuulTestCase(testtools.TestCase):
self.sched.trigger_event_queue.join()
self.sched.result_event_queue.join()
self.sched.run_handler_lock.acquire()
- if (self.sched.trigger_event_queue.empty() and
+ if (not self.merge_client.build_sets and
+ self.sched.trigger_event_queue.empty() and
self.sched.result_event_queue.empty() and
self.fake_gerrit.event_queue.empty() and
- not self.merge_client.build_sets and
self.haveAllBuildsReported() and
self.areAllBuildsWaiting()):
self.sched.run_handler_lock.release()