Due to 497234e7 / issue #456.
497234e7
@ -97,6 +97,7 @@ class CallFunctionTest(testlib.RouterMixin, testlib.TestCase):
recv = self.local.call_async(time.sleep, 120)
time.sleep(0.05) # Ensure GIL is released
self.broker.shutdown()
self.broker_shutdown = True
exc = self.assertRaises(mitogen.core.ChannelError,
lambda: recv.get())
self.assertEquals(exc.args[0], self.router.respondent_disconnect_msg)
@ -388,12 +388,14 @@ class DockerizedSshDaemon(object):
class BrokerMixin(object):
broker_class = mitogen.master.Broker
broker_shutdown = False
def setUp(self):
super(BrokerMixin, self).setUp()
self.broker = self.broker_class()
def tearDown(self):
if not self.broker_shutdown:
self.broker.join()
super(BrokerMixin, self).tearDown()