summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Henkel <tobias.henkel@bmw.de>2019-03-04 22:27:22 +0100
committerTobias Henkel <tobias.henkel@bmw.de>2019-03-07 21:10:33 +0100
commit878fcc939741f3514cd1562fd9c7e621267a2fba (patch)
tree9741cf8489b44f41f02025e29d0500dcf73d0243
parentf72682f4772a4b88073ced489cce142c2fef0718 (diff)
Fix test race in test_client_dequeue_change_by_ref
This is a try to fix a test race in test_client_dequeue_change_by_ref because of a hard coded sleep. Instead if the sleep wait for the two builds of master and stable to appear. Change-Id: I326b85c006edbe1f6a194d8abd7632b6035e82b2
Notes
Notes (review): Code-Review+2: James E. Blair <corvus@inaugust.com> Code-Review+2: Jeremy Stanley <fungi@yuggoth.org> Workflow+1: Tobias Henkel <tobias.henkel@bmw.de> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 07 Mar 2019 21:02:24 +0000 Reviewed-on: https://review.openstack.org/640878 Project: openstack-infra/zuul Branch: refs/heads/master
-rw-r--r--tests/unit/test_scheduler.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index 3611cde..417fbeb 100644
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -3965,9 +3965,12 @@ class TestScheduler(ZuulTestCase):
3965 self.executor_server.hold_jobs_in_build = True 3965 self.executor_server.hold_jobs_in_build = True
3966 self.commitConfigUpdate('common-config', 'layouts/timer.yaml') 3966 self.commitConfigUpdate('common-config', 'layouts/timer.yaml')
3967 self.sched.reconfigure(self.config) 3967 self.sched.reconfigure(self.config)
3968 self.waitUntilSettled()
3969 3968
3970 time.sleep(5) 3969 # We expect that one build for each branch (master and stable) appears.
3970 for _ in iterate_timeout(30, 'Wait for two builds that are hold'):
3971 if len(self.builds) == 2:
3972 break
3973 self.waitUntilSettled()
3971 3974
3972 client.dequeue( 3975 client.dequeue(
3973 tenant='tenant-one', 3976 tenant='tenant-one',