Show More
@@ -20,6 +20,7 b' import sys' | |||||
20 | import time |
|
20 | import time | |
21 |
|
21 | |||
22 | import zmq |
|
22 | import zmq | |
|
23 | from nose import SkipTest | |||
23 |
|
24 | |||
24 | from IPython import parallel as pmod |
|
25 | from IPython import parallel as pmod | |
25 | from IPython.parallel import error |
|
26 | from IPython.parallel import error | |
@@ -39,6 +40,7 b' class TestLoadBalancedView(ClusterTestCase):' | |||||
39 |
|
40 | |||
40 | def test_z_crash_task(self): |
|
41 | def test_z_crash_task(self): | |
41 | """test graceful handling of engine death (balanced)""" |
|
42 | """test graceful handling of engine death (balanced)""" | |
|
43 | raise SkipTest("crash tests disabled, due to undesirable crash reports") | |||
42 | # self.add_engines(1) |
|
44 | # self.add_engines(1) | |
43 | ar = self.view.apply_async(crash) |
|
45 | ar = self.view.apply_async(crash) | |
44 | self.assertRaisesRemote(error.EngineError, ar.get, 10) |
|
46 | self.assertRaisesRemote(error.EngineError, ar.get, 10) | |
@@ -60,6 +62,7 b' class TestLoadBalancedView(ClusterTestCase):' | |||||
60 | view = self.view |
|
62 | view = self.view | |
61 | ar = self.client[:].apply_async(time.sleep, .5) |
|
63 | ar = self.client[:].apply_async(time.sleep, .5) | |
62 | ar = self.client[:].apply_async(time.sleep, .5) |
|
64 | ar = self.client[:].apply_async(time.sleep, .5) | |
|
65 | time.sleep(0.2) | |||
63 | ar2 = view.apply_async(lambda : 2) |
|
66 | ar2 = view.apply_async(lambda : 2) | |
64 | ar3 = view.apply_async(lambda : 3) |
|
67 | ar3 = view.apply_async(lambda : 3) | |
65 | view.abort(ar2) |
|
68 | view.abort(ar2) |
@@ -22,6 +22,7 b' from tempfile import mktemp' | |||||
22 | from StringIO import StringIO |
|
22 | from StringIO import StringIO | |
23 |
|
23 | |||
24 | import zmq |
|
24 | import zmq | |
|
25 | from nose import SkipTest | |||
25 |
|
26 | |||
26 | from IPython import parallel as pmod |
|
27 | from IPython import parallel as pmod | |
27 | from IPython.parallel import error |
|
28 | from IPython.parallel import error | |
@@ -40,6 +41,7 b' class TestView(ClusterTestCase):' | |||||
40 |
|
41 | |||
41 | def test_z_crash_mux(self): |
|
42 | def test_z_crash_mux(self): | |
42 | """test graceful handling of engine death (direct)""" |
|
43 | """test graceful handling of engine death (direct)""" | |
|
44 | raise SkipTest("crash tests disabled, due to undesirable crash reports") | |||
43 | # self.add_engines(1) |
|
45 | # self.add_engines(1) | |
44 | eid = self.client.ids[-1] |
|
46 | eid = self.client.ids[-1] | |
45 | ar = self.client[eid].apply_async(crash) |
|
47 | ar = self.client[eid].apply_async(crash) | |
@@ -185,8 +187,8 b' class TestView(ClusterTestCase):' | |||||
185 |
|
187 | |||
186 | ar = v.push(ns, block=False, track=True) |
|
188 | ar = v.push(ns, block=False, track=True) | |
187 | self.assertTrue(isinstance(ar._tracker, zmq.MessageTracker)) |
|
189 | self.assertTrue(isinstance(ar._tracker, zmq.MessageTracker)) | |
188 | self.assertEquals(ar.sent, ar._tracker.done) |
|
|||
189 | ar._tracker.wait() |
|
190 | ar._tracker.wait() | |
|
191 | self.assertEquals(ar.sent, ar._tracker.done) | |||
190 | self.assertTrue(ar.sent) |
|
192 | self.assertTrue(ar.sent) | |
191 | ar.get() |
|
193 | ar.get() | |
192 |
|
194 | |||
@@ -271,7 +273,7 b' class TestView(ClusterTestCase):' | |||||
271 |
|
273 | |||
272 | def test_abort(self): |
|
274 | def test_abort(self): | |
273 | view = self.client[-1] |
|
275 | view = self.client[-1] | |
274 |
ar = view.execute('import time; time.sleep( |
|
276 | ar = view.execute('import time; time.sleep(1)', block=False) | |
275 | ar2 = view.apply_async(lambda : 2) |
|
277 | ar2 = view.apply_async(lambda : 2) | |
276 | ar3 = view.apply_async(lambda : 3) |
|
278 | ar3 = view.apply_async(lambda : 3) | |
277 | view.abort(ar2) |
|
279 | view.abort(ar2) | |
@@ -316,7 +318,9 b' class TestView(ClusterTestCase):' | |||||
316 | sio = StringIO() |
|
318 | sio = StringIO() | |
317 | savestdout = sys.stdout |
|
319 | savestdout = sys.stdout | |
318 | sys.stdout = sio |
|
320 | sys.stdout = sio | |
319 | ip.magic_px('print a') |
|
321 | # just 'print a' worst ~99% of the time, but this ensures that | |
|
322 | # the stdout message has arrived when the result is finished: | |||
|
323 | ip.magic_px('import sys,time;print a; sys.stdout.flush();time.sleep(0.2)') | |||
320 | sys.stdout = savestdout |
|
324 | sys.stdout = savestdout | |
321 | buf = sio.getvalue() |
|
325 | buf = sio.getvalue() | |
322 | self.assertTrue('[stdout:' in buf, buf) |
|
326 | self.assertTrue('[stdout:' in buf, buf) |
General Comments 0
You need to be logged in to leave comments.
Login now