Try to make test_idle less racy

Reconfiguration should be synchronous, but just in case, wait
afterwords.  The second wait may be more important -- we might
still have some outstanding timer events from the previous
configuration so we should make sure that everything really has
stopped before we release builds.

Change-Id: I52a3b0c309dc87fc6a553e690286d5dae093e085
This commit is contained in:
James E. Blair 2016-02-04 16:48:31 -08:00
parent 2a6cc76d18
commit 995fc0fc5b
1 changed files with 2 additions and 1 deletions

View File

@ -2742,11 +2742,11 @@ class TestScheduler(ZuulTestCase):
'tests/fixtures/layout-idle.yaml')
self.sched.reconfigure(self.config)
self.registerJobs()
self.waitUntilSettled()
# The pipeline triggers every second, so we should have seen
# several by now.
time.sleep(5)
self.waitUntilSettled()
# Stop queuing timer triggered jobs so that the assertions
# below don't race against more jobs being queued.
@ -2754,6 +2754,7 @@ class TestScheduler(ZuulTestCase):
'tests/fixtures/layout-no-timer.yaml')
self.sched.reconfigure(self.config)
self.registerJobs()
self.waitUntilSettled()
self.assertEqual(len(self.builds), 2)
self.worker.release('.*')