Skip to content

Commit f9b863a

Browse files
author
Simon MacMullen
committed
Ensure that we always interleave start / stop / start / stop.
1 parent 1861006 commit f9b863a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rabbit_tests.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ test_log_management_during_startup() ->
808808
%% start application with logging to non-existing directory
809809
TmpLog = "/tmp/rabbit-tests/test.log",
810810
delete_file(TmpLog),
811+
ok = control_action(stop_app, []),
811812
ok = application:set_env(rabbit, error_logger, {file, TmpLog}),
812813

813814
ok = delete_log_handlers([rabbit_error_logger_file_h]),
@@ -816,6 +817,7 @@ test_log_management_during_startup() ->
816817

817818
%% start application with logging to directory with no
818819
%% write permissions
820+
ok = control_action(stop_app, []),
819821
TmpDir = "/tmp/rabbit-tests",
820822
ok = set_permissions(TmpDir, 8#00400),
821823
ok = delete_log_handlers([rabbit_error_logger_file_h]),
@@ -830,6 +832,7 @@ test_log_management_during_startup() ->
830832

831833
%% start application with logging to a subdirectory which
832834
%% parent directory has no write permissions
835+
ok = control_action(stop_app, []),
833836
TmpTestDir = "/tmp/rabbit-tests/no-permission/test/log",
834837
ok = application:set_env(rabbit, error_logger, {file, TmpTestDir}),
835838
ok = add_log_handlers([{error_logger_file_h, MainLog}]),
@@ -849,12 +852,13 @@ test_log_management_during_startup() ->
849852

850853
%% start application with standard error_logger_file_h
851854
%% handler not installed
855+
ok = control_action(stop_app, []),
852856
ok = application:set_env(rabbit, error_logger, {file, MainLog}),
853857
ok = control_action(start_app, []),
854-
ok = control_action(stop_app, []),
855858

856859
%% start application with standard sasl handler not installed
857860
%% and rabbit main log handler installed correctly
861+
ok = control_action(stop_app, []),
858862
ok = delete_log_handlers([rabbit_sasl_report_file_h]),
859863
ok = control_action(start_app, []),
860864
passed.

0 commit comments

Comments
 (0)