1616
1717import glob
1818import os
19+ import shutil
1920
2021import jinja2 as jinja2
2122import psutil
@@ -113,7 +114,7 @@ def create_config_file(tpl_name, file_name, **kwargs):
113114 f .write (template .render (** kwargs ))
114115
115116
116- def _start_ignite (idx = 1 , debug = False , use_ssl = False , cluster_idx = 1 , jvm_opts = '' ):
117+ def _start_ignite (idx = 1 , debug = False , use_ssl = False , enable_auth = False , cluster_idx = 1 , jvm_opts = '' ):
117118 clear_logs (idx )
118119
119120 runner = get_ignite_runner ()
@@ -123,19 +124,21 @@ def _start_ignite(idx=1, debug=False, use_ssl=False, cluster_idx=1, jvm_opts='')
123124 if debug :
124125 env ["JVM_OPTS" ] = env .get ("JVM_OPTS" , '' ) + \
125126 "-Djava.net.preferIPv4Stack=true -Xdebug -Xnoagent -Djava.compiler=NONE " \
126- "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address={ 5005} "
127+ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 "
127128
128129 if jvm_opts :
129130 env ["JVM_OPTS" ] = env .get ("JVM_OPTS" , '' ) + jvm_opts
130131
131132 port_offset = (cluster_idx - 1 ) * 10
132133 params = {
133- 'ignite_instance_idx' : str ( idx ) ,
134+ 'ignite_instance_idx' : idx ,
134135 'ignite_client_port' : 10800 + idx ,
135136 'use_ssl' : use_ssl ,
137+ 'enable_auth' : enable_auth ,
136138 'discovery_port' : 48500 + port_offset ,
137139 'discovery_port_range' : 48510 + port_offset ,
138140 'communication_port' : 48100 + port_offset ,
141+ 'connector_port' : 10080 + idx ,
139142 }
140143
141144 create_config_file ('log4j.xml.jinja2' , f'log4j-{ idx } .xml' , ** params )
@@ -146,7 +149,7 @@ def _start_ignite(idx=1, debug=False, use_ssl=False, cluster_idx=1, jvm_opts='')
146149
147150 srv = subprocess .Popen (ignite_cmd , env = env , cwd = get_test_dir ())
148151
149- started = wait_for_condition (lambda : check_server_started (idx ), timeout = 30 )
152+ started = wait_for_condition (lambda : check_server_started (idx ), timeout = 60 )
150153 if started :
151154 return srv
152155
@@ -168,3 +171,10 @@ def get_log_files(idx=1):
168171def clear_logs (idx = 1 ):
169172 for f in get_log_files (idx ):
170173 os .remove (f )
174+
175+
176+ def clear_workdir ():
177+ for path in get_ignite_dirs ():
178+ work_dir = os .path .join (path , 'work' )
179+ if os .path .exists (work_dir ):
180+ shutil .rmtree (work_dir , ignore_errors = True )
0 commit comments