Skip to content

Commit

Permalink
don't call master.db.setup() twice, as it leaves stray threads
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Nov 5, 2012
1 parent 86eeb4c commit 536a998
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion master/buildbot/test/integration/test_master.py
Expand Up @@ -45,9 +45,15 @@ def do_test_master(self):
yield m.db.setup(check_version=False)
yield m.db.model.upgrade()

# start the service
# stub out m.db.setup since it was already called above
m.db.setup = lambda : None

# mock reactor.stop (which trial *really* doesn't
# like test code to call!)
mock_reactor = mock.Mock(spec=reactor)
mock_reactor.callWhenRunning = reactor.callWhenRunning

# start the service
yield m.startService(_reactor=mock_reactor)
self.failIf(mock_reactor.stop.called,
"startService tried to stop the reactor; check logs")
Expand Down

0 comments on commit 536a998

Please sign in to comment.