From aed92219aacf962a9d6c71ea448809fe2c9acae6 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 13 Dec 2018 16:38:52 +0100 Subject: [socket-nif|test] Add a "global" logger Added a global logger that make it possible to log from the slave nodes (with "ease"). Also "fixed" the test case that failed on "older" linux (Ubuntu 14.04). For now we let it skip instead (we should really check the OS version). Also corrected a couple of (ping-pong) cases for which the buffer adjustments did not work. OTP-14831 --- erts/emulator/test/socket_test_evaluator.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'erts/emulator/test/socket_test_evaluator.erl') diff --git a/erts/emulator/test/socket_test_evaluator.erl b/erts/emulator/test/socket_test_evaluator.erl index e8755a9512..48fb6a027e 100644 --- a/erts/emulator/test/socket_test_evaluator.erl +++ b/erts/emulator/test/socket_test_evaluator.erl @@ -76,6 +76,7 @@ %% ============================================================================ -define(LIB, socket_test_lib). +-define(LOGGER, socket_test_logger). -define(EXTRA_NOTHING, '$nothing'). -define(ANNOUNCEMENT_START, '$start'). @@ -122,6 +123,8 @@ loop(ID, [#{desc := Desc, loop(ID + 1, Cmds, State); {ok, NewState} -> loop(ID + 1, Cmds, NewState); + {skip, Reason} -> + exit({skip, Reason}); {error, Reason} -> eprint("command ~w failed: " "~n Reason: ~p", [ID, Reason]), @@ -160,6 +163,8 @@ await_finish(Evs, Fails) -> iprint("unknown process ~p died (normal)", [Pid]), await_finish(Evs, Fails) end; + {'DOWN', _MRef, process, Pid, {skip, Reason}} -> + ?LIB:skip(Reason); {'DOWN', _MRef, process, Pid, Reason} -> case lists:keysearch(Pid, #ev.pid, Evs) of {value, #ev{name = Name}} -> @@ -486,6 +491,5 @@ print(Prefix, F, A) -> SName -> f("[~s][~p]", [SName, self()]) end, - FStr = f("[~s]~s ~s" ++ F, [?LIB:formated_timestamp(), IDStr, Prefix | A]), - io:format(user, FStr ++ "~n", []), - io:format(FStr, []). + ?LOGGER:format("[~s]~s ~s" ++ F, + [?LIB:formated_timestamp(), IDStr, Prefix | A]). -- cgit v1.2.3