@@ -204,7 +204,7 @@ def indexing_plugin__installed(indexing_config=(), server_env_options={}):
204
204
]
205
205
irods_config .commit (irods_config .server_config , irods_config .server_config_path )
206
206
irods_config = IrodsConfig (** server_env_options )
207
- IrodsController (irods_config ).restart ()
207
+ IrodsController (irods_config ).reload_configuration ()
208
208
try :
209
209
yield
210
210
finally :
@@ -991,30 +991,34 @@ def test_load_parameters_as_int_or_string__91(self):
991
991
cli_env ['irods_log_level' ] = 7
992
992
new_client_env = json .dumps (cli_env , sort_keys = True , indent = 4 , separators = (',' , ': ' ))
993
993
994
- server_config_filename = paths . server_config_path ()
995
- with open ( server_config_filename ) as f :
996
- svr_cfg = json . load ( f )
997
- svr_cfg [ 'log_level' ][ 'legacy' ] = 'debug'
998
- new_server_config = json . dumps ( svr_cfg , sort_keys = True , indent = 4 , separators = ( ',' , ': ' ))
999
-
1000
- with lib . file_backed_up ( server_config_filename ), lib . file_backed_up ( env_filename ):
1001
- with open (server_config_filename , 'w' ) as f :
1002
- f . write ( new_server_config )
1003
- with open ( env_filename , 'w' ) as f_env :
1004
- f_env . write ( new_client_env )
1005
- config_0 = { 'minimum_delay_time' : 20 , 'maximum_delay_time' : 25 , 'job_limit_per_collection_indexing_operation' : 2001 }
1006
- for test_config in [ config_0 , # try once with integers ...
1007
- { k : str ( v ) for k , v in config_0 . items ()} ]: # and once with strings
1008
- with session . make_session_for_existing_admin () as ses :
1009
- with indexing_plugin__installed ( indexing_config = test_config ) :
994
+ try :
995
+ server_config_filename = paths . server_config_path ()
996
+ with open ( server_config_filename ) as f :
997
+ svr_cfg = json . load ( f )
998
+ svr_cfg [ 'log_level' ][ 'legacy' ] = 'debug'
999
+ new_server_config = json . dumps ( svr_cfg , sort_keys = True , indent = 4 , separators = ( ',' , ': ' ))
1000
+
1001
+ with lib . file_backed_up (server_config_filename ), lib . file_backed_up ( env_filename ) :
1002
+ with open ( server_config_filename , 'w' ) as f :
1003
+ f . write ( new_server_config )
1004
+ with open ( env_filename , 'w' ) as f_env :
1005
+ f_env . write ( new_client_env )
1006
+ config_0 = { 'minimum_delay_time' : 20 , 'maximum_delay_time' : 25 , 'job_limit_per_collection_indexing_operation' : 2001 }
1007
+ for test_config in [ config_0 , # try once with integers ...
1008
+ { k : str ( v ) for k , v in config_0 . items ()} ]: # and once with strings
1009
+ with session . make_session_for_existing_admin () as ses :
1010
1010
log_offset = lib .get_file_size_by_path (paths .server_log_path ())
1011
- ses .assert_icommand ('ils' , 'STDOUT' );
1012
- lib .delayAssert (lambda : all (
1013
- 1 <= lib .count_occurrences_of_string_in_log ( log_path = paths .server_log_path (),
1014
- string = "value of {name}: {value}" .format (** locals ()),
1015
- start_index = log_offset )
1016
- for name , value in test_config .items ()
1017
- ))
1011
+ with indexing_plugin__installed (indexing_config = test_config ):
1012
+ ses .assert_icommand ('ils' , 'STDOUT' );
1013
+ lib .delayAssert (lambda : all (
1014
+ 1 <= lib .count_occurrences_of_string_in_log ( log_path = paths .server_log_path (),
1015
+ string = "value of {name}: {value}" .format (** locals ()),
1016
+ start_index = log_offset )
1017
+ for name , value in test_config .items ()
1018
+ ))
1019
+
1020
+ finally :
1021
+ IrodsController ().reload_configuration ()
1018
1022
1019
1023
if __name__ == '__main__' :
1020
1024
unittest .main ()
0 commit comments