buildbot/buildbot — pull request #842 by bukzor (2013-08-22 01:39:51+00:00)
Title: Buck nine fix clean shutdown deadlock

This is a rough cut, but I would like comments on my testing procedure.
I feel that this is vastly over-complicated, but I don't see a similar way.

All tests do pass, but there are still known problems (which indicates missing test coverage, to me):

* The botmaster will not know about or wait for builds scheduled after the brd stopService finishes.
* Trigger steps after the brd has started shutting down (waitForFinish=True or otherwise) will not cause new builds since maybeStartBuildsOn still has the `if not self.running: return`.

My primary concern is the missing test coverage, as it's not clear to me how to write tests for those behaviors without inordinate complexity.