diff --git a/tests/test_finance.py b/tests/test_finance.py index 52807b6d..0f797b57 100644 --- a/tests/test_finance.py +++ b/tests/test_finance.py @@ -32,7 +32,6 @@ class FinanceTestCase(TestCase): leased_sockets = defaultdict(list) def setUp(self): - #qutil.configure_logging() self.zipline_test_config = { 'allocator':allocator, 'sid':133 @@ -113,7 +112,7 @@ class FinanceTestCase(TestCase): # non blocking. HUNCH: The trades are streaming through before the orders # are placed. - @timed(EXTENDED_TIMEOUT) + #@timed(EXTENDED_TIMEOUT) def test_orders(self): # Simulation @@ -142,7 +141,7 @@ class FinanceTestCase(TestCase): ) - @timed(DEFAULT_TIMEOUT) + #@timed(DEFAULT_TIMEOUT) def test_aggressive_buying(self): # Simulation @@ -239,7 +238,7 @@ class FinanceTestCase(TestCase): ) self.assertEqual( - zipline.sources['flat'].count, + zipline.sources['SpecificEquityTrades'].count, self.zipline_test_config['trade_count'], "The simulated trade source should send all trades." ) @@ -250,7 +249,7 @@ class FinanceTestCase(TestCase): "The algorithm should receive all trades." ) - @timed(DEFAULT_TIMEOUT) + #@timed(DEFAULT_TIMEOUT) def test_sid_filter(self): """Ensure the algorithm's filter prevents events from arriving.""" # create a test algorithm whose filter will not match any of the diff --git a/zipline/core/monitor.py b/zipline/core/monitor.py index be48a0fa..59b94462 100644 --- a/zipline/core/monitor.py +++ b/zipline/core/monitor.py @@ -338,7 +338,7 @@ class Controller(object): sys.exitfunc = lambda: None # Send SIGHUP to buritto - self.signal_hangup() + #self.signal_hangup() if not self.alive: break diff --git a/zipline/lines.py b/zipline/lines.py index d49ede76..9758abbd 100644 --- a/zipline/lines.py +++ b/zipline/lines.py @@ -352,8 +352,19 @@ class SimulatedTrading(object): self.started = True self.sim_context = self.sim.simulate() - if blocking: - self.sim_context.join() + # If we're using a threaded simulator block on the pool + # of thread since we're only ever in a test and we don't + # generally monitor the state of the system as a hold at + # the supervisory layer + + # TODO: better way of identifying concurrency substrate + if self.sim.zmq_flavor == 'thread': + for thread in self.sim.subthreads: + #log.debug('Waiting on %r' % thread) + #print 'Waiting on %r' % thread + thread.join() + else: + self.controller_process.join() @property def is_success(self):