#NEWLINE# def setup( ) : #NEWLINE# #INDENT# cluster_dir = os . path . join ( get_ipython_dir ( ) , 'profile_iptest' ) #NEWLINE# engine_json = os . path . join ( cluster_dir , 'security' , 'ipcontroller-engine.json' ) #NEWLINE# client_json = os . path . join ( cluster_dir , 'security' , 'ipcontroller-client.json' ) #NEWLINE# for json in ( engine_json , client_json ) : #NEWLINE# #INDENT# if os . path . exists ( json ) : #NEWLINE# #INDENT# os . remove ( json ) #NEWLINE# #UNINDENT# #UNINDENT# cp = TestProcessLauncher ( ) #NEWLINE# cp . cmd_and_args = ( ipcontroller_cmd_argv + [ '--profile=iptest' , '--log-level=50' ] ) #NEWLINE# cp . start ( ) #NEWLINE# launchers . append ( cp ) #NEWLINE# tic = time . time ( ) #NEWLINE# while ( ( not os . path . exists ( engine_json ) ) or ( not os . path . exists ( engine_json ) ) ) : #NEWLINE# #INDENT# if ( cp . poll ( ) is not None ) : #NEWLINE# #INDENT# print ( cp . poll ( ) ) #NEWLINE# raise RuntimeError ( 'The test controller failed to start.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( time . time ( ) - tic ) > 10 ) : #NEWLINE# #INDENT# raise RuntimeError ( 'Timeout waiting for the test controller to start.' ) #NEWLINE# #UNINDENT# #UNINDENT# time . sleep ( 0.1 ) #NEWLINE# #UNINDENT# add_engines ( 1 )