diff options
author | Micael Karlberg <[email protected]> | 2019-06-24 12:22:45 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-06-27 18:35:27 +0200 |
commit | 9ef3a76da1eef43d2c466c0aa68c18a0863bdbc2 (patch) | |
tree | 8c3b5f9bee028cb74c4680014c6568514503fcfb /lib | |
parent | 0781183c6802e0993dd954a03ee4631b4270301c (diff) | |
download | otp-9ef3a76da1eef43d2c466c0aa68c18a0863bdbc2.tar.gz otp-9ef3a76da1eef43d2c466c0aa68c18a0863bdbc2.tar.bz2 otp-9ef3a76da1eef43d2c466c0aa68c18a0863bdbc2.zip |
[snmp|agent|test] Add another "skip point"
A test run where the node died after a series of "busy dist port"
events and then the node died which caused the process that ran
the test case to crash with reason = noconnection. And since this
was a "permanent" node, the remaining test cases then crashed.
Again, this has nothing to do with snmp or its test suites.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/snmp/test/snmp_agent_test_lib.erl | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/lib/snmp/test/snmp_agent_test_lib.erl b/lib/snmp/test/snmp_agent_test_lib.erl index 783bb3b4bf..5ff79cb3a9 100644 --- a/lib/snmp/test/snmp_agent_test_lib.erl +++ b/lib/snmp/test/snmp_agent_test_lib.erl @@ -319,7 +319,7 @@ tc_try(N, M, F, A) -> await_tc_runner_done(Runner, OldFlag); pang -> ?EPRINT2("tc_try -> ~p *not* running~n", [N]), - exit({node_not_running, N}) + skip({node_not_running, N}) end. await_tc_runner_started(Runner, OldFlag) -> @@ -346,9 +346,22 @@ await_tc_runner_started(Runner, OldFlag) -> await_tc_runner_done(Runner, OldFlag) -> receive {'EXIT', Runner, Reason} -> - ?EPRINT2("TC runner failed: " - "~n ~p~n", [Reason]), - exit({tx_runner_failed, Reason}); + %% This is not a normal (tc) failure (that is the clause below). + %% Instead the tc runner process crashed, for some reason. So + %% check if have got any system events, and if so, skip. + SysEvs = snmp_test_global_sys_monitor:events(), + if + (SysEvs =:= []) -> + ?EPRINT2("TC runner failed: " + "~n ~p~n", [Reason]), + exit({tx_runner_failed, Reason}); + true -> + ?EPRINT2("TC runner failed when we got system events: " + "~n Reason: ~p" + "~n Sys Events: ~p" + "~n", [Reason, SysEvs]), + skip([{reason, Reason}, {system_events, SysEvs}]) + end; {tc_runner_done, Runner, {'EXIT', Rn}, Loc} -> ?PRINT2("call -> done with exit: " "~n Rn: ~p" @@ -367,8 +380,8 @@ await_tc_runner_done(Runner, OldFlag) -> case Ret of {error, Reason} -> exit(Reason); - {skip, _} = SKIP -> - exit(SKIP); + {skip, Reason} -> + skip(Reason); OK -> OK end @@ -460,6 +473,21 @@ tc_run(Mod, Func, Args, Opts) -> (catch snmp_test_mgr:stop()), Res end; + %% try apply(Mod, Func, Args) of + %% Res -> + %% (catch snmp_test_mgr:stop()), + %% Res + %% catch + %% throw:Res -> + %% Res; + %% C:E:S -> + %% ?EPRINT2("Failed (tc) apply: " + %% "~n Class: ~p" + %% "~n Error: ~p" + %% "~n Stack: ~p", [C, E, S]), + %% (catch snmp_test_mgr:stop()), + %% ?FAIL({apply_failed, {Mod, Func, Args}, {C, E, S}}) + %% end; {error, Reason} -> ?EPRINT2("Failed starting (test) manager: " @@ -1180,7 +1208,7 @@ do_expect(trap, Enterp, Generic, Specific, ExpVBs, To) -> (SysEvs =:= []) -> Error; true -> - throw({skip, {system_events, SysEvs}}) + skip({system_events, SysEvs}) end; @@ -1367,7 +1395,7 @@ do_expect2(Check, Type, Err, Idx, ExpVBs, To) (SysEvs =:= []) -> Error; true -> - {skip, {system_events, SysEvs}} + skip({system_events, SysEvs}) end; @@ -1818,6 +1846,10 @@ rpc(Node, F, A) -> join(Dir, File) -> filename:join(Dir, File). + +skip(R) -> + exit({skip, R}). + %% await_pdu(To) -> %% await_response(To, pdu). %% |