Merge "Fix race in test_queue_rate_limiting_dependent" into feature/zuulv3

changes/05/482405/1
Jenkins 5 years ago committed by Gerrit Code Review
commit 91fad2609f
  1. 5
      tests/base.py
  2. 5
      tests/unit/test_scheduler.py

@ -2342,6 +2342,11 @@ class ZuulTestCase(BaseTestCase):
if count is not None and i >= count:
break
def getSortedBuilds(self):
"Return the list of currently running builds sorted by name"
return sorted(self.builds, key=lambda x: x.name)
def release(self, job):
if isinstance(job, FakeBuild):
job.release()

@ -3367,8 +3367,9 @@ class TestScheduler(ZuulTestCase):
# Only C's test jobs are queued because window is still 1.
self.assertEqual(len(self.builds), 2)
self.assertEqual(self.builds[0].name, 'project-test1')
self.assertEqual(self.builds[1].name, 'project-test2')
builds = self.getSortedBuilds()
self.assertEqual(builds[0].name, 'project-test1')
self.assertEqual(builds[1].name, 'project-test2')
self.executor_server.release('project-.*')
self.waitUntilSettled()

Loading…
Cancel
Save