From 1df2cdb7d3e234bebd7ed6fb88081b324b69952d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 2 Jul 2019 16:16:22 +0200 Subject: [snmp|agent|test] Add another "skip point" We have hosts (mostly *very* slooow VMs) that can timeout anything. Since we are basically testing communication, we therefor must check for system events at every failure. Grrr! --- lib/snmp/test/snmp_agent_test_lib.erl | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'lib/snmp/test/snmp_agent_test_lib.erl') diff --git a/lib/snmp/test/snmp_agent_test_lib.erl b/lib/snmp/test/snmp_agent_test_lib.erl index 07600bbaf7..615d6774b9 100644 --- a/lib/snmp/test/snmp_agent_test_lib.erl +++ b/lib/snmp/test/snmp_agent_test_lib.erl @@ -481,10 +481,24 @@ tc_run(Mod, Func, Args, Opts) -> (catch snmp_test_mgr:stop()), ?SKIP(Reason); {'EXIT', Reason} -> - ?EPRINT2("apply exit catched: " - "~n ~p", [Reason]), + %% We have hosts (mostly *very* slooow VMs) that + %% can timeout anything. Since we are basically + %% testing communication, we therefor must check + %% for system events at every failure. Grrr! + SysEvs = snmp_test_global_sys_monitor:events(), (catch snmp_test_mgr:stop()), - ?FAIL({apply_failed, {Mod, Func, Args}, Reason}); + if + (SysEvs =:= []) -> + ?EPRINT2("TC runner failed: " + "~n ~p~n", [Reason]), + ?FAIL({apply_failed, {Mod, Func, Args}, Reason}); + true -> + ?EPRINT2("apply exit catched when we got system events: " + "~n Reason: ~p" + "~n Sys Events: ~p" + "~n", [Reason, SysEvs]), + ?SKIP([{reason, Reason}, {system_events, SysEvs}]) + end; Res -> (catch snmp_test_mgr:stop()), Res -- cgit v1.2.3