Blessed commit.

This commit is contained in:
Stephen Diehl
2012-07-05 17:29:16 -04:00
parent 3d5e084b8d
commit b9e0be6bf0
4 changed files with 18 additions and 19 deletions
+6
View File
@@ -44,8 +44,14 @@ class ZiplineWithTransformsTestCase(TestCase):
self.assertFalse(zipline.sim.exception)
class FinanceTransformsTestCase(TestCase):
def setUp(self):
self.trading_environment = factory.create_trading_environment()
self.log_handler = LoggingHandler()
self.log_handler.push_application()
def tearDown(self):
self.log_handler.pop_application()
def test_vwap(self):
+2 -11
View File
@@ -16,9 +16,6 @@ class ComponentHost(object):
"""
def __init__(self, addresses):
self.init(addresses)
def init(self, addresses):
self.addresses = addresses
self.running = False
@@ -48,14 +45,8 @@ class ComponentHost(object):
"""
log.info('===== PARENT PID: %s' % os.getppid())
if catch_exceptions:
try:
self._run()
except Exception as exc:
exc_info = sys.exc_info()
# Reraise the exception
raise exc_info[0], exc_info[1], exc_info[2]
#self.shutdown()
self.open()
#self.shutdown()
def shutdown(self, ensure_clean=True):
raise NotImplementedError
+8 -7
View File
@@ -164,7 +164,8 @@ class Controller(object):
# -----------------------
# The last breathe of the interpreter will assume that we've
# failed unless we specify otherwise.
sys.exitfunc = self.signal_interrupt
if not self.devel:
sys.exitfunc = self.signal_interrupt
# We overload this if ( and only if ) the topology exits
# cleanly. This prevents failure modes where the monitor
# dies.
@@ -332,7 +333,7 @@ class Controller(object):
if self.devel:
log.warn("Shutting down Controller because in devel mode")
sys.exitfunc = lambda: None
#sys.exitfunc = lambda: None
self.shutdown(soft=True)
log.info('Heartbeat (%s, %s)' % (done, complete))
@@ -351,10 +352,10 @@ class Controller(object):
self.shutdown(soft=True)
# Noop exit func
sys.exitfunc = lambda: None
#sys.exitfunc = lambda: None
# Send SIGHUP to buritto
#self.signal_hangup()
self.signal_hangup()
if not self.alive:
break
@@ -640,7 +641,7 @@ class Controller(object):
log.info('Soft Shutdown')
self.send_softkill()
self.do_error_replay()
#self.do_error_replay()
self.pub.close()
self.router.close()
#self.pub.close()
#self.router.close()
+2 -1
View File
@@ -396,9 +396,10 @@ class SimulatedTrading(object):
if self.sim.zmq_flavor == 'thread':
log.debug('Blocking')
for thread in self.sim.subthreads:
#log.debug('Waiting on %r' % thread)
log.debug('Waiting on %r' % thread)
#print 'Waiting on %r' % thread
thread.join()
log.debug('Yielded on %r' % thread)
else:
for process in self.sim.subprocesses:
process.join()