Move re-enqueue to pipeline processing

Moving the re-enqueue step after a reconfiguration to the pipeline
processing phase allows us to re-enqueue multiple pipelines in
parallel in a multi-scheduler environment.

In case of a failure the re-enqueue can also be retried the next time
the pipeline is processed.

Change-Id: Iad483c37610b51d94ead72573c3540b1dea9ab84
This commit is contained in:
Simon Westphahl
2021-10-20 14:29:27 +02:00
parent 4ebedf55e1
commit 4faf5498e4
6 changed files with 91 additions and 18 deletions

View File

@@ -347,6 +347,7 @@ class TestGerritToGithubCRD(ZuulTestCase):
self.waitUntilSettled()
self.scheds.execute(lambda app: app.sched.reconfigure(app.config))
self.waitUntilSettled()
# Make sure the items still share a change queue, and the
# first one is not live.
@@ -798,6 +799,7 @@ class TestGithubToGerritCRD(ZuulTestCase):
self.waitUntilSettled()
self.scheds.execute(lambda app: app.sched.reconfigure(app.config))
self.waitUntilSettled()
# Make sure the items still share a change queue, and the
# first one is not live.

View File

@@ -517,6 +517,7 @@ class TestGerritCRD(ZuulTestCase):
self.waitUntilSettled()
self.scheds.execute(lambda app: app.sched.reconfigure(app.config))
self.waitUntilSettled()
# Make sure the items still share a change queue, and the
# first one is not live.

View File

@@ -446,6 +446,7 @@ class TestGerritLegacyCRD(ZuulTestCase):
self.waitUntilSettled()
self.scheds.execute(lambda app: app.sched.reconfigure(app.config))
self.waitUntilSettled()
# Make sure the items still share a change queue, and the
# first one is not live.

View File

@@ -5481,6 +5481,7 @@ class TestScheduler(ZuulTestCase):
self.commitConfigUpdate('org/common-config',
'layouts/reconfigure-window2.yaml')
self.scheds.execute(lambda app: app.sched.reconfigure(app.config))
self.waitUntilSettled()
tenant = self.scheds.first.sched.abide.tenants.get('tenant-one')
queue = tenant.layout.pipelines['gate'].queues[0]
# Even though we have configured a smaller window, the value
@@ -5489,6 +5490,7 @@ class TestScheduler(ZuulTestCase):
self.assertTrue(len(self.builds), 4)
self.scheds.execute(lambda app: app.sched.reconfigure(app.config))
self.waitUntilSettled()
tenant = self.scheds.first.sched.abide.tenants.get('tenant-one')
queue = tenant.layout.pipelines['gate'].queues[0]
self.assertEqual(queue.window, 20)
@@ -5539,6 +5541,7 @@ class TestScheduler(ZuulTestCase):
self.assertEqual(len(self.builds), 4)
self.scheds.execute(lambda app: app.sched.reconfigure(app.config))
self.waitUntilSettled()
tenant = self.scheds.first.sched.abide.tenants.get('tenant-one')
queue = tenant.layout.pipelines['gate'].queues[0]
self.assertEqual(queue.window, 1)