Fix bug w/ None event in Github event forwarder
Change Ie54fc16488ab8cbc15f97d003f36c12b8a648ed4 introduced a bug in the Github event forwarder thread that is triggered whenever the GithubEventProcessor doesn't produce an event. In case the event was None the GithubEventForwarder stopped instead of continuing with the next future in the queue. Change-Id: Ibd76c1a787f5b8bd186bcb271bc526fe5e5ddade
This commit is contained in:
parent
92f43d874a
commit
5c620ddc9d
|
@ -1291,6 +1291,23 @@ class TestGithubDriver(ZuulTestCase):
|
|||
if report[2] == 'merge']
|
||||
assert(len(merges) == 1 and merges[0][3] == 'squash')
|
||||
|
||||
@simple_layout('layouts/basic-github.yaml', driver='github')
|
||||
def test_invalid_event(self):
|
||||
# Regression test to make sure the event forwarder thread continues
|
||||
# running in case the event from the GithubEventProcessor is None.
|
||||
self.fake_github.emitEvent(("pull_request", "invalid"))
|
||||
self.waitUntilSettled()
|
||||
|
||||
A = self.fake_github.openFakePullRequest('org/project', 'master',
|
||||
'A')
|
||||
self.fake_github.emitEvent(A.getPullRequestOpenedEvent())
|
||||
self.waitUntilSettled()
|
||||
|
||||
self.assertEqual('SUCCESS',
|
||||
self.getJobFromHistory('project-test1').result)
|
||||
self.assertEqual('SUCCESS',
|
||||
self.getJobFromHistory('project-test2').result)
|
||||
|
||||
|
||||
class TestGithubUnprotectedBranches(ZuulTestCase):
|
||||
config_file = 'zuul-github-driver.conf'
|
||||
|
|
|
@ -752,7 +752,7 @@ class GithubEventConnector:
|
|||
return
|
||||
event = future.result()
|
||||
if not event:
|
||||
return
|
||||
continue
|
||||
self.connection.logEvent(event)
|
||||
if isinstance(event, DequeueEvent):
|
||||
self.connection.sched.addManagementEvent(event)
|
||||
|
|
Loading…
Reference in New Issue