##// END OF EJS Templates
switch order of failed-to-start errors in test_embed_kernel...
MinRK -
Show More
@@ -23,7 +23,7 b' from subprocess import Popen, PIPE'
23 import nose.tools as nt
23 import nose.tools as nt
24
24
25 from IPython.zmq.blockingkernelmanager import BlockingKernelManager
25 from IPython.zmq.blockingkernelmanager import BlockingKernelManager
26 from IPython.utils import path
26 from IPython.utils import path, py3compat
27
27
28
28
29 #-------------------------------------------------------------------------------
29 #-------------------------------------------------------------------------------
@@ -68,17 +68,19 b' def setup_kernel(cmd):'
68 )
68 )
69 # wait for connection file to exist, timeout after 5s
69 # wait for connection file to exist, timeout after 5s
70 tic = time.time()
70 tic = time.time()
71 while not os.path.exists(connection_file) and kernel.poll() is None and time.time() < tic + 5:
71 while not os.path.exists(connection_file) and kernel.poll() is None and time.time() < tic + 10:
72 time.sleep(0.1)
72 time.sleep(0.1)
73
73
74 if kernel.poll() is not None:
75 o,e = kernel.communicate()
76 e = py3compat.cast_unicode(e)
77 raise IOError("Kernel failed to start:\n%s" % e)
78
74 if not os.path.exists(connection_file):
79 if not os.path.exists(connection_file):
75 if kernel.poll() is None:
80 if kernel.poll() is None:
76 kernel.terminate()
81 kernel.terminate()
77 raise IOError("Connection file %r never arrived" % connection_file)
82 raise IOError("Connection file %r never arrived" % connection_file)
78
83
79 if kernel.poll() is not None:
80 raise IOError("Kernel failed to start")
81
82 km = BlockingKernelManager(connection_file=connection_file)
84 km = BlockingKernelManager(connection_file=connection_file)
83 km.load_connection_file()
85 km.load_connection_file()
84 km.start_channels()
86 km.start_channels()
General Comments 0
You need to be logged in to leave comments. Login now