The Gatekeeper, or a project gating system
Go to file
James E. Blair 7fc8daa372 Stop sharing Gerrit event queues in tests
When connections are set up in tests, multiple Gerrit connections which
are configured to connect to the same fake Gerrit server share a change
database so that changes sent to Gerrit via one connection are reflected
back to Zuul on another.  They also share an event queue so that events
injected on one are seen by another.

Unfortunately, that part doesn't work, and in fact, events are only seen
by one of the gerrit connections.  This happens to work since it doesn't
matter which gerrit connection receives an event, which is why we haven't
noticed the problem in tests.

Where we do see the problem in Zuulv3 is in shutting down the connections.
When a GerritConnection is stopped, a sentinal object (None) is added to
the event queue.  When the GerritConnection gets an event from the queue,
it first checks whether it has stopped before processing that event.
Because in tests (but not in production) multiple GerritConnections share
an event queue, the connection that adds the None object to the queue
may not be the one that receives it, which causes the test to raise an
exception and not stop correctly.

We did not notice this in v2 because the order in which the Queue.Queue
class decides to awaken a thread is deterministic enough that the thread
which submitted the sentinel was always the one that received it.  In
v3, the thread order is sufficiently different that the thread for the
*other* connection is reliably the one which receives it.

To correct this, stop using a shared queue between the differing
GerritConnection objects, and instead add a helper method to the testcase
class which will add an event to every connection for a given server.

Change-Id: Idd3238f5ab8f5e09e295c0fa028e140c089a2a3f
2016-08-10 09:11:44 -07:00
doc Add some documentation on functional testing tools 2016-08-08 11:16:11 -07:00
etc Merge "Expose webapp listen_address and port" 2016-07-12 23:31:02 +00:00
tests Stop sharing Gerrit event queues in tests 2016-08-10 09:11:44 -07:00
tools Merge "Use high precedence when manually submitting jobs" 2016-07-12 23:27:28 +00:00
zuul Stop sharing Gerrit event queues in tests 2016-08-10 09:11:44 -07:00
.gitignore Merge master into feature/zuulv3 2016-02-12 14:10:03 +11:00
.gitreview Set default branch to feature/zuulv3 2015-12-07 11:28:01 -08:00
.mailmap Fix pep8 E127 violations 2012-09-26 14:23:10 +00:00
.testr.conf Reduce Log Size 2016-06-10 10:15:50 -07:00
LICENSE Initial commit. 2012-05-29 14:49:32 -07:00
MANIFEST.in Migrate to pbr. 2013-06-25 19:04:30 +00:00
NEWS.rst Fix two typos on zuul documentation 2015-07-28 22:16:32 +09:00
README.rst Switched documentation to point to storyboard. 2014-11-11 15:59:24 -08:00
TESTING.rst Support multiple triggers 2013-08-01 11:56:52 -07:00
other-requirements.txt Add support for bindep 2016-06-03 23:52:33 -04:00
requirements.txt Merge branch 'master' into v3_merge 2016-07-14 22:36:59 +10:00
setup.cfg Add ansible launch server 2016-04-22 09:52:05 -07:00
setup.py Partial sync with OpenStack requirements. 2013-09-25 15:30:37 -07:00
test-requirements.txt Enhance CRD doc with diagrams 2015-11-18 15:19:51 +11:00
tox.ini Merge branch 'master' into v3_merge 2016-07-14 22:36:59 +10:00

README.rst

Zuul

Zuul is a trunk gating system developed for the OpenStack Project.

Contributing

To browse the latest code, see: https://git.openstack.org/cgit/openstack-infra/zuul/tree/ To clone the latest code, use git clone git://git.openstack.org/openstack-infra/zuul

Bugs are handled at: https://storyboard.openstack.org/#!/project/679

Code reviews are, as you might expect, handled by gerrit. The gerrit they use is http://review.openstack.org

Use git review to submit patches (after creating a gerrit account that links to your launchpad account). Example:

# Do your commits
$ git review
# Enter your username if prompted